Don't erase EEPROM with new firmware/flash

doglike
Posts: 16
Joined: Fri Aug 18, 2017 4:21 pm

Don't erase EEPROM with new firmware/flash

Postby doglike » Fri May 10, 2019 11:52 pm

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!

ESP_Sprite
Posts: 2761
Joined: Thu Nov 26, 2015 4:08 am

Re: Don't erase EEPROM with new firmware/flash

Postby ESP_Sprite » Mon May 13, 2019 10:17 am

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?

doglike
Posts: 16
Joined: Fri Aug 18, 2017 4:21 pm

Re: Don't erase EEPROM with new firmware/flash

Postby doglike » Mon May 13, 2019 4:50 pm

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 :(

ESP_Sprite
Posts: 2761
Joined: Thu Nov 26, 2015 4:08 am

Re: Don't erase EEPROM with new firmware/flash

Postby ESP_Sprite » Tue May 14, 2019 2:50 am

Ah, gotcha. This is pretty Arduino-specific, so I'll move your post to that forum.

doglike
Posts: 16
Joined: Fri Aug 18, 2017 4:21 pm

Re: Don't erase EEPROM with new firmware/flash

Postby doglike » Tue May 14, 2019 8:44 am

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.

boarchuz
Posts: 110
Joined: Tue Aug 21, 2018 5:28 am

Re: Don't erase EEPROM with new firmware/flash

Postby boarchuz » Tue May 14, 2019 8:54 am

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.

Who is online

Users browsing this forum: Baidu [Spider], brolly759 and 6 guests