cmaglie / FlashStorage

A convenient way to store data into Flash memory on the ATSAMD21 and ATSAMD51 processor family
203 stars 69 forks source link

EEPROM flash address #18

Closed Adminius closed 6 years ago

Adminius commented 6 years ago

hi @cmaglie, i tried to understand were the EEPROM-data is stored, but i found an address pointer to an array only: https://github.com/cmaglie/FlashStorage/blob/master/src/FlashStorage.cpp#L29 is this dynamic and depends on sketch size? can i define my own const flash-address?

i will try to adapt SDU library to run update within internal flash (yes with about 50% of storage lost). but i also need EEPROM emulation. for example: SDU (or IFU=internal flash update) is placed on 0x2000+ sketch is placed on 0x6000+ EEPROM is on last x flash bytes (lets say 8192 bytes) 1fst half of the available area between 0x6000 and EEPROM is for sketch and a second for new FW.

that's like in a datasheet: grafik

Adminius commented 6 years ago

I answer it by my self: Here is example of own addresses: https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SDU/extras/SDUBoot/SDUBoot.ino#L66

P.S. IFU works as expected:)