Page 1 of 1
Don't erase EEPROM with new firmware/flash
Posted: Fri May 10, 2019 11:52 pm
by doglike
Hey,
is there any possibility / option, that the EEPROM will not be erased with a new firmware/flash?
I am collecting data during the whole runtime and want to use them further beyond a new flash...
Thanks in advance!
Re: Don't erase EEPROM with new firmware/flash
Posted: Mon May 13, 2019 10:17 am
by ESP_Sprite
What EEPROM do you mean? There's no such part in a canonical ESP32 system, although there is flash; that normally wouldn't be entirely erased when uploading new firmware, however. Can you give us some more information about what data you're trying to save, and how you flash your ESP32?
Re: Don't erase EEPROM with new firmware/flash
Posted: Mon May 13, 2019 4:50 pm
by doglike
Sorry, of course.... I mean the flash area (EEPROM emulation), that is accessible with the arduino lib EEPROM.h
I am saving data in a 2D-matrix with
EEPROM.put. With
EEPROM.get I can access my matrix again after reboot. Everything is fine.
But after re-flash my data is gone
Re: Don't erase EEPROM with new firmware/flash
Posted: Tue May 14, 2019 2:50 am
by ESP_Sprite
Ah, gotcha. This is pretty Arduino-specific, so I'll move your post to that forum.
Re: Don't erase EEPROM with new firmware/flash
Posted: Tue May 14, 2019 8:44 am
by doglike
Hmm is this really arduino specific?
I am just using the lib to get access to the "EEPROM" area, but developing with eclipse/esp-idf.
I had hoped to customize the flash process somehow, so that the "EEPROM" area will not be erased.
Re: Don't erase EEPROM with new firmware/flash
Posted: Tue May 14, 2019 8:54 am
by boarchuz
NVS is not typically erased during a firmware flash, so this pseudo partition type of "EEPROM" must act a little differently, and that's definitely specific to Arduino.
Interestingly, EEPROM implementation has just been overhauled for the next release to use a normal NVS partition. See
https://github.com/espressif/arduino-es ... 78b3a5643b
I'd suggest updating (or waiting for next release), or using the superior Preferences library instead.