How to define LittleFS partition, build image and flash it on ESP32?

OK, I will continue to investigate, although not right now as I got it to work (with the EXE version) and I have other urgent things to do. Will report back if/when I will know more.

Thanks again for your input!

I think my solution for LittleFsV2 is easy to implement.
You need:

  • python installed
  • these two files: (download)
  • one line in your project - > platformio.ini
  1. install python and test if its useable form your VS terminal window.

  2. drop the two files one directory above your project directory.
    This is my project directory:
    “E:\Arduino und Derivate\PlatformIO_Projects\Projects\Sensor Typ B”
    This is where the upload files are located (similar to SPIFFS upload directory):
    “E:\Arduino und Derivate\PlatformIO_Projects\Projects\Sensor Typ B\data”
    This is where you place the files (LittleFSBuilder.py and mklittlefs.exe):
    "E:\Arduino und Derivate\PlatformIO_Projects\Projects"

  3. After you have done this the only thing you need to do is add the following line to your platformio.ini
    extra_scripts = ../LittleFSBuilder.py
    Adding this line means that LittleFsV2 file system will be used. If you dont add it The file system will be default (SPIFFS)
    Steps 1. and 2. are only initial needed. (At least if your projects have a path structure like mine. If not, feel free to mod the python script)

1 Like

but imho this should be implemented by platformIO itself:
On the one hand LillteFS is the official successor of SPIFFS. Even vscode marks it as deprecated.
On the other hand der is this fuddling around with custom scripts, posted “somewhere on the internet”

It feels wrong :wink:

You talk about a world that would be beautiful, but does not exist like this. Everybody who is more intensively engaged in programming and all that goes with it, knows these conditions well enough. I myself would have preferred to save the time instead of struggling with the search for a solution. - be glad that you don’t have these problems 20 years before and that there is “somebody from the internet”, who is able to chew a solution for you. - I know other times :wink:

That’s why our developers are already looking into it. ESP8266 NodeMCV1 LittleFS workflow? - #3 by valeros

2 Likes

Ah, nice. Didn’t see that one. Thanks 4 info.

It’s my understanding the LittleFS supports folders and SPIFFS didn’t.
I tried uploading folders with the provided script, but it failed :frowning:
Could the python script (mklittlefs.py) be edited to support folders?

See here, it may be interesting for you, it is about LITTLEFS on ESP32:

UPDATE:
Dont use my script solution (post above ^^)
LittleFs is implemented and can be uploader by “Upload File System Image”!
You just need to add this line to your project / platformio.ini
board_build.filesystem = littlefs

2 Likes

@whitelionatx
board_build.filesystem = littlefs works on esp8266.
Are you sure it is implemented for esp32?
On my tests adding this line changes nothing on esp32 (framework = arduino)
Can you please show the image upload output difference with and without this line? It should look different if indeed different FS are used.
Also please clarify better your “post above ^^” because one post just above is actually my post.
Thank you

1 Like

I would have thought the

Dont use my script solution

before that would have given away that it’s not your post, but perhaps that’s just me :stuck_out_tongue:

@whitelionatx I don’t beleive this is the case - I don’t see any mention of LittleFS changes for the ESP32, so it doesn’t look like there is any PlatformIO support there yet. And there probably won’t be, since it’s not even supported in the ESP32 Arduino core or ESPIDF natively, but needs to be bolted on via extra components or libraries… as lorol did on June 28 in this issue.

1 Like

ok ok, I am sorry to clear this up.

I tried to say that this post of mine is deprecated:

The last time I tested only with a ESP8266 (not with ESP32) and my solution didn´t work so I wrote this post.

I guess i was a bit hasty with that. i concluded from the fact that it used to work with my own solution with ESP8266 and ESP32 that it no longer works in both cases. I apologize for this and refer you back to the script solution (my own or another one) for the ESP32 case.

Sorry for that.

1 Like

Here is everything you need to run a LittleFS on esp32 including Uploading Filesystem Image on PlatformIO:

Working Example

That’s it