-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
ESP32-C3 Preferences: nvs_get_blob len fail: schedule NOT_FOUND #6572
Comments
There is no error checking in that example. It seems likely that the NVS is unable to either open the namespace or is completely full. Erase your flash and try again. |
I've erased the flash a few times before that, changed partition to default and made sure it was. Tried on 3 different chips, 2 devkits and 1 Lolin mini. Before I swapped out the EEPROM library routines to use Preferences, this is the error I was getting when I updated from 2.0.2 to 2.0.3rc1 assert failed: esp_err_t nvs::Page::copyItems(nvs::Page&) nvs_page.cpp:500 (end <= ENTRY_COUNT) I tried to use the exception decoder but even after trying 3 different versions of the Arduino IDE installed, I couldn't get it to work. It was pretty clear it was something to do with nvs though. Let me know if there's anything else I can do |
Just an fyi, I don't know if this has anything to do with the fact the same project does not mount the SPIFFS partition either. I even tried the example SPIFFS code in PIO and ArduinoIDE. Both give same result: Attempting to boot anyway...entry 0x403ce000E (180) SPIFFS: mount failed, -10025E (15468) SPIFFS: mount failed, -10025[ 15431][E][SPIFFS.cpp:114] format(): Formatting SPIFFS failed! Error: -1[ 15432][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1SPIFFS Mount Failed I almost thought the flash got permanently corrupted on the boards somehow because both SPIFFS and nvs were giving me problems but reverting back to 2.0.2 everything works as it should. |
Probably unrelated but I noticed the config folder and the containing sdkconfig.h is missing in latest from .../tools/sdk/esp32c3/include/ |
Make sure to run tools/get.py (but I think you would get much nastier compilation errors if this was the problem). I am unable to reproduce the problem with Preferences or SPIFFS with a new esp32-c3 board that I grabbed out of the box. |
Thanks. my ESP32 works with Pref and SPIFFS examples, but my C3's still gives same errors. Reverted back again to 2.0.2 to double check and both examples ran fine on C3. It's back to the latest now and trying a few different things, It's prob some config thing I'm doing wrong. I'll post back in a bit as soon as I figure out what's going on. |
Did you perhaps have encryption turned on at some point? I can't think of what else would cause your nvs to fail. Try the following and see if you get some more info about what failed.
|
Thanks, the only encryption I had was encrypted flags in a custom partition for later use but no fuses set or any follow up on those flags. Chips have all been erased and set with default partitions since then and operate normally until the commit mentioned below. After a few branch changes, I found the one which is causing my issues. Commit 8ee5f0a is causing the issues for me with SPIFFS and Preferences. Running the code you posted with Esp32 s3 support (#6341): 8ee5f0a
Below is running it with the commit just before S3 support 3f79097
Same for the example code with SPIFFS and Preferences. There's many files changed in Esp32 s3 support (#6341), but I'm thinking it's a library that's common to SPIFFS & nvs maybe? It's like it can't find the partitions anymore |
@lbernstone I think I've tried everything I can think of. Still getting the bootloop with the ESP32-C3-DevKitC-02 and the Lolin C3 Mini.
Running the ESP32-C3-DevKitC-02 I get similar (not new but erased flash and using default.csv partition) with RC-1
I thought it was an issue finding the partitions but running this code with RC-1, partitions are found on both boards.
OUTPUT for DevkitC using RC-1
Output for Lolin mini using RC-1
So, not sure what's going on. 'Almost' everything else on RC-1 works on these boards, I say almost because I have a project I tried running with these boards on the latest and it uses many of Ard/esp32 libraries and it it all works. Webserver, Ledc, http client, wifi using STA + AP etc. Only the SPIFFS and NVS(Preferences) issues are present ( I didn't try LittleFS though). If you or anyone has any ideas, please let me know if there's something I could try. The fixes/additions in RC-1 are very helpful, especially the USB/Seria/JTAG support for the Lolin mini which doesn't have a uart chip. Edit: It's getting past the nvs init and nvs commit functions without error, returning zero and a handle of 1. |
Can not reproduce. Platformio using 2.0.3 rc1
Counter example:
|
Fixed with #6614 |
This should be reopened. Using jason2866's framework is not really a solution. I think it can be reproduced by using flash mode DIO in Arduino. |
@lbernstone can you share your sketch to reproduce this issue? |
It's been a while but I think the issue was with get.exe. After using Jason's framework I noticed the only thing that changed was the updated esptool version. (although I didn't check the board files or variants to see if those changed). Even though I deleted all packages several times and ran get.exe from the repo I did not get the updated esptoolpy that seemed to correct the problem for me. Possibly it was a partition issue or allowing read/write permissions with an older version of esptool? as all sample code and functions ran error free except when trying to read/write nvs or spiffs. The flash mode is in the boards file? correct? I didn't look to see if that was different but would it be able to upload without error in DIO? EDIT: I see now, I was using DIO in the platformio.ini until Jason's framework, but I think it's QIO that gives an error when uploading. |
Start_counter example:
QIO (note that it still says DIO)
|
@lbernstone says DIO but it's actually switched later to QIO. Still... very strange issue... any chance you test with other modes too? Does frequency matter? |
@me-no-dev |
@P-R-O-C-H-Y you tested in our |
@me-no-dev I tested SPIFFS example in ESP-IDF. |
can you check with |
@me-no-dev Same issue with |
@P-R-O-C-H-Y now that is a very interesting case... WHY? :D |
@me-no-dev Good question :D |
@me-no-dev it depends how it is build with the arduino lib builder. |
@Jason2866 we found the problem and it is fixed in the soon-to-be-merged release/v4.4 branch/pr (also in the lib-builder) |
can we close this @P-R-O-C-H-Y? |
Yes, fixed by PR #6910. |
I'm experiencing the same issue after upgrading the espressif framework in platformIO. Sketch was running fine before the upgrade, using
Then upgraded to latest with
esp_get_idf_version() reports version = v4.4.1-472-gc9140caf8c Suddenly I'm getting following error for each preferences.getBytes I'm doing: The issue is no longer occurring when I add following line in the platformio.ini To me the issue happened when I get types bytes or Uchar but was not happening when I'm getting Bool or UInt. |
@PaMor969 Which |
Hi @Jason2866 Apart from the issue with preferences.getBytes/getUChar (and one small thing related to System Volume Information when reading file structure on an SD card), I have not encountered any other problems since I have upgraded my environment. |
The platformio pico32 boards.json is WRONG regarding flash mode. |
Sorry to jump in to a closed issue. PlatformIO uses the same flash mode settings as specified in the latest |
@lbernstone
|
@QGB Do you really use latest core 2.0.5 with all updates? Which esptool version is used? There where bugs, which are all solved with latest version. |
@Jason2866
|
Choosen settings? Which board? Flash size? Partition scheme? Esptool version? |
Board
ESP32-C3 Devkitc
Device Description
Nothing attached
Hardware Configuration
Nothing attached
Version
latest master
IDE Name
PIO
Operating System
Win10
Flash frequency
80
PSRAM enabled
no
Upload speed
115200
Description
Preferences e.g. code giving error in latest release. Works in 2.0.2
I also can't format or mount SPIFFS on a C3 but I believe that is fixed in PR #6569 ?
Returning err -1
Sketch
https://github.com/espressif/arduino-esp32/blob/master/libraries/Preferences/examples/Prefs2Struct/Prefs2Struct.ino
Debug Message
Other Steps to Reproduce
Just running example code
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: