Page 1 of 1

Recommended Filesystem Type?

Posted: Fri Oct 27, 2023 8:58 am
by dmglogowski
Hello there!

We are currently working on an industrial application using ESP-IDF and an ESP-32S3-WROOM-2 module.

For this application we need to save some amount of data on the Chips flash itself, mostly configuration data and similar, rather than an external data store like an SD Card. We know we can define a filesystem partition using a custom partitions table. However we aren't sure what filesystem we want to use.

We know that SPIFFS and FAT are supported officially and that there is a port of littlefs for ESP32s. We also know that there are some inherent issues with SPIFFS so we are leaning towards using either FAT with Wear Levelling or littlefs.

Does anybody have any recommendations in that regard? Maybe some further tips?

Thanks in advance!

Re: Recommended Filesystem Type?

Posted: Fri Oct 27, 2023 9:12 am
by ESP_Sprite
For configuration, maybe nvs will do the job?

Re: Recommended Filesystem Type?

Posted: Mon Oct 30, 2023 7:12 am
by dmglogowski
We thought about NVS, and it may be the right choice for some options, but we have to store some pretty large amounts of data, preferably in JSON format, so NVS isn't the right choice for the majority. But some things we can likely store in NVS.

Re: Recommended Filesystem Type?

Posted: Mon Oct 30, 2023 8:27 am
by martins
NVS for configurations for sure. I did not try FAT, I had issues with SPIFFS, but LittleFS turned out to be faster and without issues - used that one for storing webpages in 4MB partition for example.

Re: Recommended Filesystem Type?

Posted: Mon Oct 30, 2023 10:59 am
by pacucha42
Hi @dmglogowski,
NVS is designed for storing configuration values in a form of key:value pairs, and it introduces extra overhead and limitations needed for internal handling of the data. It is not suitable as a common file-system - just to confirm your findings. Details available at https://docs.espressif.com/projects/esp ... flash.html.

For storing general data (incl. large datasets), I recommend the FatFS filesystem (https://docs.espressif.com/projects/esp ... fatfs.html). It's frequently used and performs well for the most scenarios - SPIFFS can be troublesome due to its garbage collection design (significant slowdown when the files occupy more than 2/3 of available partition space, for instance), it doesn't support directories etc.

LittleFS may work for you as well, depending on your application details.

Re: Recommended Filesystem Type?

Posted: Thu Nov 02, 2023 7:06 am
by dmglogowski
Thanks to everyone for their input!

It is currently looking like we are going to use FAT with wear levelling for the larger JSON style configurations and NVS for other configs which can change easily on the fly.