How to mount LittleFS to ESP32 WROOM chip using Platformio?

O my god,

One character’s typo, killed two men two days. :joy:

Now, everything works fine!!

Also, notice that in the partition table, it must use “spiffs”, rather than “littlefs”,

default_4MB.csv:

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x140000,
app1,     app,  ota_1,   0x150000,0x140000,
spiffs, data, spiffs,0x290000,0x160000,
coredump, data, coredump,0x3F0000,0x10000,

It must be “spiffs, data, spiffs,0x290000,0x160000,”

Not allow “littlefs, data, littlefs, 0x290000,0x160000,”

A lot a lot of thanks! You are great! @sivar2311

In ESP-IDF 5.x (Arduino 3.x → pioarduino) the subtype “littlefs” is supported per documentation: Partition Tables - ESP32 - — ESP-IDF Programming Guide latest documentation

Yes, actually we read this article before, and according to this article, “littlefs” is a legal subtype for the partition table. However,

  1. When clicking “Build Filesystem Image” and “Upload Filesystem Image” in PIO, it worked fine, built and uploaded “littlefs.bin” as expected.

  2. When we ran our program, especially LittleFS.begin(true, "/littlefs", 10U, "littlefs"), a bug was thrown in the serial monitor, complaining that “spiffs” partition cannot be found.