Best way to persistently store user data on Nano 33 IoT

Hello all!

I'm working on adapting my digital clock project to the Nano 33 IoT. It stores ~150 bytes of user data in EEPROM to recover from power cuts.

At this writing (v2.0.0), I'm using the FlashStorage library in its EEPROM emulation mode, and it works fine... but I don't like that (as I understand) it commits the entire 150 bytes to flash with every edit, not just the 1 or 2 bytes being updated. I'm loathe to wear the flash out unecessarily.

The library's standard mode seems to commit more granularly, but it requires a FlashStorage object for each value to be stored, whereas my code makes heavy use of accessing EEPROM bytes directly by location (and, I suppose, needs to continue working this way on AVR). I thought of trying to define a FlashStorage object for each byte, but besides being overkill, I'm not sure how I would address them (I know it's not possible to do dynamic variable names, and I'm not sure about making an array of these).

I suspect if my C/C++ skills (or forum searching skills) were stronger, I could look under the hood of FlashStorage and figure out how to read/write flash bytes by address (and determine which ones are safe to use) but I'm afraid it's Greek to me for now.

Or to take a completely different tack, are there other persistent storage options on this board I should consider? I've seen the WiFiNINA WiFiStorage example but I can hardly find any other documentation on it other than issues folks are having.

Can anyone advise how they would address this?

Thank you in advance!

There are several libraries that have the update function, they only update the values that have changed. You can also change blocks of EEPROM every so often if you like. Most of the EEPROM is not being used.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.