earlephilhower / arduino-littlefs-upload

Build and uploads LittleFS filesystems for the Arduino-Pico RP2040, RP2350, ESP8266, and ESP32 cores under Arduino IDE 2.2.1 or higher
MIT License
143 stars 14 forks source link

Data files seem to upload but don't appear in the Directory list #21

Closed buccaneer-jak closed 7 months ago

buccaneer-jak commented 7 months ago

On my ESP32-WROOM the LittleFS Filesystem Uploader completes and I can see in it's output that it see's the 2 files in /data but when I use listDir(LittleFS, "/", 1); the files are missing. Also readFile(LittleFS, "/test.txt"); returns '- failed to open file for reading'

Any ideas on what I am missing? My program failed to mount the LittleFS until I ran arduino-littlefs-upload and now returns 'LittleFS Mount succeeded' so all good there, plus I can now create a file and append to it and then successfully read from it so the file system seems ok. I have tried rerunning the LittleFS Upload again, also reporting success but still the same problem.

OUTPUT:

LittleFS Filesystem Uploader

Using partition: default Building LittleFS filesystem C:\Users\jak\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933/mklittlefs.exe -c C:\Users\jak\OneDrive\Documents\Arduino\Sketches\Testing\ESP32programmer_V2_LittleFS/data -p 256 -b 4096 -s 1441792 C:\Users\jak\AppData\Local\Temp\tmp-20504-r33zl9OocohW-.littlefs.bin /config.txt /test.txt

Uploading LittleFS filesystem C:\Users\jak\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe --chip esp32 --port COM5 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 2686976 C:\Users\jak\AppData\Local\Temp\tmp-20504-r33zl9OocohW-.littlefs.bin esptool.py v4.5.1 Serial port COM5 Connecting..... Chip is ESP32-D0WDQ6 (revision v1.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 30:c6:f7:05:7b:98 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Auto-detected Flash size: 4MB Flash will be erased from 0x00290000 to 0x003effff... Compressed 1441792 bytes to 1773... Writing at 0x00290000... (100 %) Wrote 1441792 bytes (1773 compressed) at 0x00290000 in 4.0 seconds (effective 2875.6 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin...

Completed upload.

buccaneer-jak commented 7 months ago

I seem to have fixed it but unclear how. I changed the Board type and then changed it back again and then also changed the Partition Scheme from Minimal (1.3MB APP / 700KB SPIFFS) to the Default 4Mb with spiffs (1.2MB APP / 1.5 MB SPIFFS)

Strangely without re-running LittleFS Upload I can now see the files.

SOLUTION: After switching the partition back I know realize that the problem is the smaller SPIFFS size although I didn't record any warnings from either LittleFS Upload or the compiler about lack of FS space.