Hello,
I am able to initialize littleFS correctly (and have a lot of experience using it) using the Arduino IDE. I decided to move to PlatformIO to reduce compile time and have had no problems except getting LittleFS to initialize using the exact same files that I am using with Arduino IDE.
My data directory is in the same directory as my src directory.
I have included board_build.filesystem = littlefs in my .ini file
I have run a clean
I have successfully built the filesystem image with no errors.
I have confirmed that it creates a littlefs.bin file.
I have successfully uploaded the file image with no errors.
I have tried custom partition files.
Regardless of what I do, littleFS.begin() fails.
Could you share the actual code you wrote for LittltFS.begin()?
Regarding ESP32-S3, C3, and C6, I have never encountered any failures with the following code.
LITTLEFS.begin(false, "/spiffs");
In this case, ā/spiffsā is the basepath (default is ā/littlefsā) because I defined the partition name for file system in (partitions).CSV as āspiffsā.
What is different about your code?
Let me explain in more detail why āLITTLEFSā is written in capital letters.
Previously, LittleFS was an external library and used the name āLITTLEFS,ā but now itās supported as a standard feature of the Arduino framework, hence the name āLittltFS.ā
The example I included in my reply to you was an older code snippet I happened to pick up from many sources, so it uses āLITTLEFSā in capital letters, but you can simply read it as āLittleFS.ā
Also, files such as default.csv still use the partition name āspiffs.ā
I recommend checking the contents of the CSV file that is automatically selected based on your chosen board.
Thanks for the help. I had thought PlatformIO was using the default 4MB partition file, (the exact same partition file used successfully with the Arduino IDE) but I guess it wasnāt. I specified the following in the .ini file. I rebuilt the image. I uploaded the new image. I re-flashed the device and it worked.
board_build.partitions = default.csv
And here is the proof on my ā91 Brother AX350. Thanks!
1 Like