Library for saving non-volatile data to flash on Arduino Due

I needed an replacement for the EEPROM library on Arduni Due since it does not have EEPROM at all. Flash memory can be used in a similar so I created a library with the idea to have a similar syntax as the EEPROM library. More info at Ersättare för EEPROM på Arduino Due
and code at GitHub - sebnil/DueFlashStorage: DueFlashStorage saves non-volatile data for Arduino Due. The library is made to be similar to the EEPROM library.

Example:

// write the value 123 to address 0
dueFlashStorage.write(0,123);
 
// read byte at address 0
byte b = dueFlashStorage.read(0);

Perhaphs it will be useful for someone else.

What happens to the data when you load a new sketch?

It will unfortunately empty the stored data. I have not found a way of not making that happen.

I hope they decide to add an EEPROM I2C chip to the next board revision...