-
Notifications
You must be signed in to change notification settings - Fork 7.6k
esp32-s2 chip using Preferences library to store string but lost after the restart #5622
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
@Kevin-CEN I think this may have been fixed by #5309 which should be available in the 2.0.0 release. Can you retest with the 2.0.0 release? |
|
@Kevin-CEN Adjust your platformio.ini to have:
Most of the ESP32-S2 peripherals should have compatible Arduino code already, if you find an exception to this though do log an issue for tracking/consideration. |
@atanisoft
|
@Kevin-CEN That link error looks related to PIO breaking the builds, I guess you will need to wait for the 2.0.0 release to be picked up by PIO instead. Usually they will pick up a new stable release within a few days of release. |
@atanisoft Thank you very much.The problem doesn't seem to have been solved. |
I can confirm there is in general issue with NVS storage on PIO using arduino v2.0.0+. There is also some topic on forum about it. |
Mhh, i get this
Compiled with Platformio |
@Jason2866 Yours seems to be all right.Can I have a look at your platformio.ini file? |
@Kevin-CEN, reused the setup from the Project Tasmota (i am a member). |
@Jason2866 Thank you very much.But this configuration file of yours seems too complicated, I just tried it, it will compile wrong. |
@Kevin-CEN Okay, simplified :-)
main.cpp
|
Can you explain what went wrong with platform IO? |
Using a old setup/version of Arduino results in non working sketch for S2. |
Thank you very much. According to your instructions, I uninstalled platformIO from vscode and deleted .platformio folder. After that, I reinstalled platformIO in vscode. The following configuration is used to solve the problem that preferences cannot be saved.
|
@Kevin-CEN Can I consider this as solved? |
Closing, no asnwer. |
I wanted to use the Preferences library to store strings, using the ESP32-S2 chip, and using the official example StartCounter. ino to test, I compiled and burned without any problems, but when ESP32-S2 ran the program, the numbers didn't add up so should have been lost after the restart.
This is the output of the MCU:
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40026168
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x424
load:0x4004c000,len:0x844
load:0x40050000,len:0x2460
entry 0x4004c180
Current counter value: 1
Restarting in 10 seconds...
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40026168
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x424
load:0x4004c000,len:0x844
load:0x40050000,len:0x2460
entry 0x4004c180
Current counter value: 1
Restarting in 10 seconds...
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40026168
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x424
load:0x4004c000,len:0x844
load:0x40050000,len:0x2460
entry 0x4004c180
Current counter value: 1
Restarting in 10 seconds...
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40026168
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x424
load:0x4004c000,len:0x844
load:0x40050000,len:0x2460
entry 0x4004c180
Current counter value: 1
Restarting in 10 seconds...
############################
This is my platformio.ini configuration:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
board_build.mcu = esp32s2
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-alpha1
############################
The text was updated successfully, but these errors were encountered: