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

How to Calculate Checksum of hex file.

Hello All,

I am using LPC2364 controller and Keil uVision5 IDE.

I need to calculate checksum of Hex file each time when the device is powered on and should be compared with the pre calculated checksum. This is to make sure that the source code is unchanged.

I am newbie ... Please help me...

Parents
  • So create a byte or word pointer, set it to the base address of the flash, and then count off the bytes/words in the flash, summing the content as you go.

    A method with .HEX/.BIN files is to process the content before programming on to the chip, and place the inverse value at the end of the image so that it sums to zero, or holds a value you can compare.

    A more robust method would use a CRC

Reply
  • So create a byte or word pointer, set it to the base address of the flash, and then count off the bytes/words in the flash, summing the content as you go.

    A method with .HEX/.BIN files is to process the content before programming on to the chip, and place the inverse value at the end of the image so that it sums to zero, or holds a value you can compare.

    A more robust method would use a CRC

Children