What is the best NVS option for big data structures?

maldus
Posts: 83
Joined: Wed Jun 06, 2018 1:41 pm

What is the best NVS option for big data structures?

Postby maldus » Thu Oct 24, 2019 10:54 am

Hello everyone,
In my next project I will need to save in persistent memory up to 100 data structures about 2KB big. In previous iterations I used I2C eeproms to store such data; they are however very expensive. Since the ESP32 can include up to 16MB of flash memory I was considering that as an option.

The esp-idf library allows for several ways to save persistent data, and I am not sure which one to choose. The raw NVS library would be good enough, but I noticed this note on the documentation:
NVS works best for storing many small values, rather than a few large values of the type ‘string’ and ‘blob’. If you need to store large blobs or strings, consider using the facilities provided by the FAT filesystem on top of the wear levelling library.
So naturally I checked out the FAT module, but I have some doubts about it.
How reliable is it? Is it suited for such sizes (~100 files x ~2KB)? I will need to read from it fairly frequently, but only write data an handful of times (one time configuration mostly). Do I risk losing the entire file system in the event of a power loss during write?

It is a very new topic for me so please forgive me if my questions are silly/nonsensical.

Who is online

Users browsing this forum: suestcxf and 84 guests