This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

add magic number to bin file in keil uvision

Hi,

could someone of you tell me if it is possible to add a specific magic number to a bin file created by keil uvision?

Under "target for options" -> User-tab I added the following line to the (Run user programs after build /rebuild.

fromelf --bin ".\test.axf" --output ".\test.bin"

best regards
Jens

Parents
  • Lots of free code available that computes CRC-32 or MD5.

    But remember that you need to run the same code in the boot loader. MD5 might represent a too high protection level - which costs in code size and computation time.

    If you want to make sure they are not able to download the wrong binary, it will be enough with a magic product ID in the file. You have to reason to care about any problems a customer may have if they patch the file and changes the product ID just to be able to get the boot loader to accept the file.

    Use a 16-bit or 32-bit product ID and a CRC-32 to catch transfer errors.
    Combine with application version and expected size of file, so you can give good error messages.

Reply
  • Lots of free code available that computes CRC-32 or MD5.

    But remember that you need to run the same code in the boot loader. MD5 might represent a too high protection level - which costs in code size and computation time.

    If you want to make sure they are not able to download the wrong binary, it will be enough with a magic product ID in the file. You have to reason to care about any problems a customer may have if they patch the file and changes the product ID just to be able to get the boot loader to accept the file.

    Use a 16-bit or 32-bit product ID and a CRC-32 to catch transfer errors.
    Combine with application version and expected size of file, so you can give good error messages.

Children