ESP32 Arduino framework. FFAT FS upload insted of SPIFFS

There is a tool in PIO to upload the SPIFFS files from the data folder to the esp32 flash. I want to try out the FFAT File System but i can not upload my files in the data folder because when i try it i get this error:

Could not find the spiffs section in the partitions table C:\Users\Mr.Hitec.platformio\packages\framework-arduinoespressif32\tools\partitions\default_ffat.csv

Of course it can’t find the SPIFFS section because it is FFAT. Can i do something about it?

Can you provide some more information on this? er… I was thinking of the ESP8266 then, not the ESP32… sorry!

So I take it you’re talking about this sort of thing?

This might help: Prepare FAT image and flash it to ESP32 - ESP32 Forum

Which is about this tool

Yap. Iam talking about that FAT file system. Iam not able to work with this mkfatfs tool in arduino ide or in platformIO. Because iam not familiar with the IDF things, to make menuconfig and such things… Unfortunatelly right now iam only able to flash my esp32 SPIFFS is trought the standard PIO/Arduino mkspiffs plugin in the IDE. I don’t know how to execute make menuconfig without IDF knowledge, for example. :confused:

This may be another option… it’s only been tested for linux though, and still requires some knowledge of make, etc… it looks like Flash FAT isn’t in as the 'user friendly ’ state as far as creating the image and uploading it as SPIFFS is.

1 Like

Thank you! I gonna take a look at this.

1 Like

I just wrote a small python script to generate a filesystem e.t.c.
Should work on all platforms.

1 Like

I have just begun to immerse myself into PlatformIO :grinning:, and one of the first stumbling blocks :no_mouth: that I face is the apparent inability of pio to upload data to an ESP32-Flash with the FFat file system.

Is that really so, or am I just not seeing the solution? Any help?

Nobody seems to have filed a formal issue with platform-espressif32 to have this implemented, all talk is in the forum where the devs overlook it. I’ve opened one at Add LittleFS and FFat filesystem support · Issue #570 · platformio/platform-espressif32 · GitHub now.

Further, since nooone seems to have done this yet for PlatformIO, I implemented FatFs for Arduino-ESP32 and PlatformIO in a modified example repo, using mkfatfs (same as the Arudino IDE plugin uses) and a bit of scripting. See working example repo at GitHub - maxgerhardt/pio-esp32-fatfs-example: Example for how to use a FatFS filesystem with PlatformIO and an ESP32..

@maxgerhardt I am not sure I can follow you: what I am missing on pio for FFat is the ability to upload plain data. Partitioning the Flash for FFat works via a partition.csv file in root of the project, and formatting for FFat works via code. I use FFat routinely.

As the documentation says and as I’ve demonstrated in the example, you can create a data/ folder in the project and put your files in there, then the project task “Platform → Upload File System image” will pack the data/ folder as a filesystem binary and upload it onto the ESP32’s FFat partition. That’s how you upload plain data (or any other data files).

I am confused. The documentation clearly says:

Uploading files to file system SPIFFS

It says SPIFFS, not FFat. Following the steps explained there, my data in /data are NOT being uploaded to FFat. Clicking the Task Upload File System image results in this failure message:

Could not find the spiffs section in the partitions table /home/ullix/Code/platformio/210622-174739-esp32dev-mod1/partitions.csv

This very much looks like it wants SPIFFS and nothing else?

Yes because that is what PlatformIO can do officially, only SPIFFS. That’s why I had to expand PlatformIO’s platform-espressif32 code to allow specifying an FFAT filesystem. Of course my custom modifications are not showing up in PlatformIO’s official documentation yet. You need to use the project linked above or follow the steps as explained. However, the button for upload stays the same – Upload File System image will upload the filesystem image, just that with my mods, it can now handle FFAT and not only SPIFFS.

Ah! Thanks. As I said, just taking my first steps into pio.