lorol / LITTLEFS

LittleFS library for arduino-esp32
GNU General Public License v2.0
167 stars 68 forks source link

LITTLEFS partition not found after Deep Sleep wakeup #55

Open RalphBacon opened 2 years ago

RalphBacon commented 2 years ago

I'm using VS Code and PlatformIO. After a Deep Sleep on a 4Mb ESP32, I occasionally get messages like this:

2022-07-01 16:35:09 --> E (24) esp_littlefs: partition "wtiogs" could not be found
2022-07-01 16:35:09 --> E (25) esp_littlefs: Failed to initialize LittleFS
2022-07-01 16:35:09 --> [E][LITTLEFS.cpp:90] begin(): Mounting LITTLEFS failed! Error: 261

or

E (24) esp_littlefs: partition "ÿÿoÿÿÿÿ[E][%s:%u] %s():ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿssary in SPIFFS
2022-07-02 01:58:44 --> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ): %s does not eÿÿÿÿÿÿÿÿÿÿÿoÿÿÿÿle
2022-07-02 01:58:44 --> 
2022-07-02 01:58:44 --> " could not be found
2022-07-02 01:58:44 --> E (34) esp_littlefs: Failed to initialize LittleFS
2022-07-02 01:58:44 --> [E][LITTLEFS.cpp:90] begin(): Mounting LITTLEFS failed! Error: 261

Pressing RESET on the device restores normal functionality. Given that on the ESP32 a Deep Sleep resume is effectively the same as a normal power-up start I'm confused as to what might be happening.

My partitioning is as follows (although changing it [eg to an OTA version] doesn't seem to make any difference):

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x200000,
spiffs,   data, spiffs,  0x210000,0x1F0000,

Note that during testing, the 1 min/5 min/1 hour Deep Sleep code worked fine. As this device only wakes up once per day in production use it might be somehow sleep time related (?!).

Any ideas? BTW I reflashed the code and partitions 3 days ago and it's been working fine since - but now I dare not change the code in case I get the errors again! If it does happen again I'll revert to SPIFFS and see whether I still get the issues.