I love working with the EEPROM on Atmega’s.
I use it for “machine”- and or user-settings, that have to remain when power off,
and that have to remain when uploading a new firmware (flashing) the MCU.
since the Zero has no EEPROM one can use the flash as a kind of EEPROM.
the flash memory (and so the “emulated” EEPROM) is erased when Arduino uploads a new sketch,
is there any method to overcome this disadvantage,
so that the “EEPROM”-content survives the uploading of a new firmware ?
for example a (automated) procedure like:
download present “EEPROM”-content (special section in flash memory ?) from the MCU,
and merge it with the new flash-content (new firmware),
BEFORE uploading the new flash-content,
or something like that ?
In the Atmel ASF Framework there is described a
"SAM D20/D21 EEPROM Emulator Service "
see this document:
on page 118 and further
But unfortunately to be honest I don’t understand exactly what’s described there…
From my understanding it’s a way to preserve the “EEPROM” Data in the most upper-Section of the Flash and then to use a special FUSE-bit to prevent overwriting it (?)
(see attached screenshot - an exerpt from the pdf mentioned above)