How to use EEPROM emulation mode?

Hi All

I’ve seen here http://support.sodaq.com/sodaq-one/explorer/ that Explroer have a EEPROM emulation mode.
Unfortunatly, EEPROM standard lib from Arduino can’t be used because it’s for avr controllers only.

So, does somebody knows how to use the Explorer EEPROM?

Thx

Have a look at this library: https://github.com/cmaglie/FlashStorage

It uses the program memory space, but has the ability to update the data.

Thanks for your answer

I had a test with such a lib, and each time I flash a new version of my code on the card, data peiviously written are lost.
(It’s seems logic because flashing code is re-writing flash…)

Is there a way avoid this?

Not really, and not with that library. The library effectively reserves a row of the program memory storage space and then rewrites the data in that row every time you update the stored data. However, re-uploading will reset that space to the default values.

The MCU does support emulated EEPROM and in Atmel Studio ASF has a library for this. It basically reserves certain sections of the program storage space for the emulated EEPROM. This is done through the device fuses, you also have the option whether to wipe that area each time you program the device.

Getting this to work with Arduino would be difficult. Additionally, it would likely require some modification to the bootloader.