Recommended Filesystem Type?

dmglogowski
Posts: 3
Joined: Fri Oct 27, 2023 8:50 am

Recommended Filesystem Type?

Postby dmglogowski » Fri Oct 27, 2023 8:58 am

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!

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Recommended Filesystem Type?

Postby ESP_Sprite » Fri Oct 27, 2023 9:12 am

For configuration, maybe nvs will do the job?

dmglogowski
Posts: 3
Joined: Fri Oct 27, 2023 8:50 am

Re: Recommended Filesystem Type?

Postby dmglogowski » Mon Oct 30, 2023 7:12 am

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.

martins
Posts: 50
Joined: Tue Aug 24, 2021 8:58 am

Re: Recommended Filesystem Type?

Postby martins » Mon Oct 30, 2023 8:27 am

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.

pacucha42
Posts: 31
Joined: Fri Mar 29, 2019 12:56 pm

Re: Recommended Filesystem Type?

Postby pacucha42 » Mon Oct 30, 2023 10:59 am

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.

dmglogowski
Posts: 3
Joined: Fri Oct 27, 2023 8:50 am

Re: Recommended Filesystem Type?

Postby dmglogowski » Thu Nov 02, 2023 7:06 am

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.

Who is online

Users browsing this forum: No registered users and 249 guests