This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Calculating application code checksum



Hi!

I'm looking for ways to calculate my application code's checksum at runtime. Essentially, I want to write a routine that iterates over the application code space in FLASH and generates a simple checksum.

For this purpose, I would need to know the start address of my application code (which I will have), but the number of code words or the final address of my application code will be unknown (I assume), as I will continue to make minor revisions to the firmware over time.

Is there a symbol that is generated at compile time that contains the final address of the application code in FLASH memory? Or am I missing something?

Thanks in advance.

  • Hi Nimish

    you can declare a symbol in your linker command file at the end of your text section and refer to this in your C-code. The address of this symbol when accessed will give you the end address of the text segment.

    Should be mentioned in assembler or compiler reference guides.

    Best Regards
    Santosh