-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Writing to EEPROM on esp32s2 #5159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There's only been one minor change in readString in the last 2 years, and I can't see how that would present with these symptoms. There's a lot of logging in EEPROM, try setting core debug level to verbose and see if it throws any messages that might indicate an error. |
I've given arduino preferences a try, to see if I have any success there. |
Do the examples work for you? |
Yes. But I've modified the sketch to demonstrate that the values do not persist across reboots:
The output is always the following, no matter how many times I reboot:
|
Try wiping your device with
|
Erased the flash many times previously, and did not forget the EEPROM.commit() in the above example. Interestingly enough, your last example works for me - when writing directly to address.
Output is always:
I wish I could get you some core debug output there doesn't seem to be any with the following flags:
And every once in a while I get this weird crash:
|
EEPROM is the default instance. |
Thanks, my bad! In between doing all this testing trying to figure out what's wrong, I must have deleted the arduino-esp32 package, cleaned everything, rebuilt and reinstalled everything and somehow even my original project (the original version with EEPROM and the preferences version) works now. I guess something corrupted got stuck in some cache somewhere. Sorry for wasting your time and thanks for your help. |
I have this same exact problem using the same example program. Here's my platformio.ini, everything else I copied from this thread.
|
EEPROM is included as part of the arduino-esp32 core, so you shouldn't need it in lib_deps, and this is likely to pull in a library for avr. Note that eeprom is only provided for code portability. If you are writing code specifically for esp32, you should use Preferences. OP's issue was solved, and appears to have been an installation issue. |
Okay, I had to go scorched earth, and deleted everything in my .platformio directory. Performing a project clean did not help. This works:
|
I've updated an "old" project that was using the
https://github.com/espressif/arduino-esp32.git#idf-release/v4.2
to the new alpha version (using the latest master). The project does some EEPROM writes, which are now automagically not persisted between reboots.EEPROM.commit()
returns true and everything looks fine. If I read them back during the same boot cycle, the values are read back fine. Then I restart and all is lost.Here's a link to my project (which was working just fine under the idf-release/v4.2 branch which is now gone): https://github.com/xtrinch/esp32s2-bme280-webusb
Has something changed with the EEPROM handling between the branch I was using and the latest alpha version? Couldn't find any info.
The text was updated successfully, but these errors were encountered: