EEPROM, NVM, or other persistent storage on CPX?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- petewarden
- Posts: 2
- Joined: Sun Nov 06, 2022 10:25 pm
EEPROM, NVM, or other persistent storage on CPX?
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!
- petewarden
- Posts: 2
- Joined: Sun Nov 06, 2022 10:25 pm
Re: EEPROM, NVM, or other persistent storage on CPX?
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
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
Please be positive and constructive with your questions and comments.