EEPROM, NVM, or other persistent storage on CPX?

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
petewarden
 
Posts: 2
Joined: Sun Nov 06, 2022 10:25 pm

EEPROM, NVM, or other persistent storage on CPX?

Post by petewarden »

I have basically the same problem described in viewtopic.php?p=760624. I want to store some configuration values when the Circuit Playground Express is powered down, but I can't find a way to do it from Arduino code. The standard "EEPROM.h" header isn't present, and there isn't an obvious alternative. Any suggestions on how to make progress would be much appreciated, thanks!

User avatar
petewarden
 
Posts: 2
Joined: Sun Nov 06, 2022 10:25 pm

Re: EEPROM, NVM, or other persistent storage on CPX?

Post by petewarden »

For anybody else struggling with this, I found a solution that works using the Adafruit SPI_Flash library: https://github.com/adafruit/Adafruit_SP ... dWrite.ino

I look for a short config.bin file in setup(). If it isn't present, I create it with default values. If it is, I read the stored values. Whenever the program changes those settings, I write out a new copy of the file. The code can be found at https://github.com/usefulsensors/person ... e.ino#L107

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”