ESP32 - Little FS implementation

Hello,

I tried to implement the littleFS to an ESP32 project without succes.

I use the loro git littlefs implementation, I build the file system (with a file in data), I upload the filesystem image to my esp32, and I test it with a sample program but I get every time a " begin(): Mounting LITTLEFS failed! Error: -1

Does anyone have a sample prog that run on ESP32 ? (I use to run littlefs on esp8266 correctly)

thank you
Multinet.

No – since some time now, Arduino-ESP32 and the Espressif32 integration have native LittleFS support with the library built-in to the core and native PIO support.

As a first try, please use the platformio.ini

[env:esp32dev]
platform = espressif32
framework = arduino
board = esp32dev
board_build.filesystem = littlefs

with this src/main.cpp and this data folder. Use the “Upload File System image” project task as normal to build + upload the LittleFS image, then “Upload & monitor” the firmware.

1 Like

Hello
thank youfor taking the time to answer me

I do what to recommand but I get this error : “src/main.cpp:3:22: fatal error: LittleFS.h: No such file or directory”

Is your Espressif 32 platform up-to-date? Please open a CLI and execute

pio pkg update -g -p espressif32

and retry.

3 Likes

For anyone else who may run across this issue:

Following the above instructions did not solve the issue for me, but I found a solution:

Add this line in your platformio.ini file:

lib_ldf_mode=deep

Hope this helps someone :+1:

Edit: After I posted this I figured out that my file structure was not set up properly. I was able to restructure my lib files and then I was able to compile without the line I posted above.

1 Like

Hi,
for an old project I used LITTLEFS on Arduino, I’ve moved this project on Platformio and I’m using the 3.2.0 version of espressif package.
There is method for using the tool also whit this vesion?

Alan