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.
BUT:
the flash memory (and so the "emulated" EEPROM) is erased when Arduino uploads a new sketch,
right ?
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:
--> http://www.atmel.com/Images/Atmel-42258-ASF-Manual-SAM-D21_AP-Note_AT07627.pdf
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)
further documents:
--> http://www.atmel.com/images/atmel-42125-sam-d20-eeprom-emulator-service-eeprom_application-note_at03265.pdf
--> http://asf.atmel.com/docs/3.17.0/samd21/html/group__asfdoc__sam0__nvm__group.html
--> http://asf.atmel.com/docs/3.17.0/samd21/html/asfdoc_sam0_nvm_exqsg.html
--> http://asf.atmel.com/docs/3.17.0/samd21/html/asfdoc_sam0_nvm_basic_use_case.html
--> http://www.atmel.com/images/atmel-42114-sam-d20-d21-non-volatile-memory-driver-nvm_application-note_at03247.pdf
