Closed jrbarrick closed 3 months ago
This might be just as much as an issue with documentation.
On initial installs, in PlatformIO, you need to select "upload file system image" as well.
The upgrade probably works because there's a littlefs.format() in order to fix errors like this.
In new branches (close to being merged) I removed the spiffs upgrader (firmwares that were over two years old used spiffs). Instead of the upgrader, I should probably place a format() on boot if the files cannot be accessed.
Fwiw, using "reset to defaults" in the app or settings web page should work as well.
Thanks for the report!
Read the LittleFS docs a bit as well, looks like you can just call LittleFS.begin(true) instead of LittleFS.begin(false) and it will format the LittleFS partition if it doesn't exist. Did some testing on my end and it seems like that does the trick.
I'm guessing it was set to (false) previously for the upgrade logic to work correctly. I think for now I slightly prefer keeping the format() inside of the if statement, just for readability.
I'd love any more insight you might have! Thanks for the help!
Description
Unable to mount LittleFS after flashing firmware on new PCB, mounts fine after re-flashing with mobile app. Reproduced on 3 new PCBs. Once the issue is fixed by flashing with the mobile app, flashing later on over USB works fine.
Steps to reproduce
Chip Info:
Leaving... Hard Resetting... Hard resetting via RTS pin... Done! Flashing is complete!
Showing logs: [15:14:10][ 30]E: Compiled Apr 28 202401:49:10 [15:14:10][ 31]E: Current Board Revision is: Revision Two [15:14:10][ 33]E: Mounting Filesystem [15:14:10]./components/esp_littlefs/src/littlefs/lfs.c:1229:error: Corrupted dir pair at {0x0, 0x1} [15:14:10]E (28) esp_littlefs: mount failed, (-84) [15:14:10]E (28) esp_littlefs: Failed to initialize LittleFS [15:14:10][ 36][E][LittleFS.cpp:95] begin(): Mounting LittleFS failed! Error: -1 [15:14:10][ 38]E: An Error has occurred while mounting LittleFS. [15:14:10][ 41]E: Stopping LittleFS [15:14:10]E (34) SPIFFS: mount failed, -10025 [15:14:10][ 42][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1 [15:14:10][ 42]E: SPIFFS Not Found - Could not upgrade FS [15:14:10]./components/esp_littlefs/src/littlefs/lfs.c:1229:error: Corrupted dir pair at {0x0, 0x1} [15:14:10]E (139) esp_littlefs: mount failed, (-84) [15:14:10]E (139) esp_littlefs: Failed to initialize LittleFS [15:14:11][ 653]E: Reading File: /config.txt [15:14:11][ 655][E][vfs_api.cpp:105] open(): /littlefs/config.txt does not exist, no permits for creation [15:14:11][ 655]E: Couldn't find configuration file. [15:14:11][ 658]E: Contents of file: /config.txt [15:14:11][ 659][E][vfs_api.cpp:105] open(): /littlefs/config.txt does not exist, no permits for creation [15:14:11][ 659]E: Failed to read file [15:14:11][ 662][E][vfs_api.cpp:182] remove(): /config.txt does not exists or is directory [15:14:11][ 663]E: Writing File: /config.txt [15:14:11][ 678]E: Reading File: /userPWC.txt [15:14:11][ 681][E][vfs_api.cpp:105] open(): /littlefs/userPWC.txt does not exist, no permits for creation [15:14:11][ 682]E: Couldn't find configuration file. Loading Defaults [15:14:11][ 684]E: Contents of file: /userPWC.txt [15:14:11][ 687][E][vfs_api.cpp:105] open(): /littlefs/userPWC.txt does not exist, no permits for creation [15:14:11][ 687]E: Failed to read file [15:14:11][ 692][E][vfs_api.cpp:182] remove(): /userPWC.txt does not exists or is directory [15:14:11][ 692]E: Writing File: /userPWC.txt
[15:17:39]1. BeginOTA2. Running partition type 0 subtype 16 (offset 0x00010000) [15:17:39]3. Writing to partition subtype 17 at offset 0x1f0000 ... [15:20:20]..................................................................................4. Final byte arrivedSet Boot partionRestarting... [15:20:20][ 31]E: Current Board Revision is: Revision Two [15:20:20][ 33]E: Mounting Filesystem [15:20:20][ 38]E: Reading File: /config.txt [15:20:20][ 60]E: Config File Loaded: /config.txt [15:20:20][ 61]E: Contents of file: /config.txt [15:20:20][ 86]E: Writing File: /config.txt [15:20:20][ 110]E: Reading File: /userPWC.txt [15:20:20][ 135]E: Config File Loaded: /userPWC.txt [15:20:20][ 135]E: Contents of file: /userPWC.txt [15:20:20][ 171]E: Writing File: /userPWC.txt