Checksum / crc / flash Verification

Hi.
I have had some cases of flash memory and eeprom corruption. Especially in battery powered devices when the brownout is disabled.

Is there any way to run some sort of checksum or similar method to verify flash integrity?

I would like the atmega328p to run an integrity check at startup. If there is corruption ot should halt.

You can certainly calculate a CRC value for either flash or EEPROM memory, and compare it to a stored value. For the ATmega series, use of special instructions is required to read flash memory, and access to those instructions must be specifically enabled for your program.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.