Re-initialisation happens when virgin Arduino starts up, or a new sketch is uploaded, or an existing sketch is upgraded with incompatible changes to the EEPROM layout.
The Arduino sketch must recognise these three conditions.
Ian Hogg suggests using a version number that is used to detect updates to the EEPROM layout.
To detect a change of sketch, detect a change in moduleID. (and possibly manufacturerID) Today, the moduleID is provided in the parameters set, but is not persisted in EEPROM.
There is a suggestion to use a checksum for all the key values that describe the current sketch as listed above. If the checksum changes then re-initialise the EEPROM.
Re-initialisation happens when virgin Arduino starts up, or a new sketch is uploaded, or an existing sketch is upgraded with incompatible changes to the EEPROM layout.
The Arduino sketch must recognise these three conditions.
Ian Hogg suggests using a version number that is used to detect updates to the EEPROM layout.
To detect a change of sketch, detect a change in moduleID. (and possibly manufacturerID) Today, the moduleID is provided in the parameters set, but is not persisted in EEPROM.
There is a suggestion to use a checksum for all the key values that describe the current sketch as listed above. If the checksum changes then re-initialise the EEPROM.