Does NVS use wear leveling? If not, any plans to support it?
In our use case, we update a value in NVS every few mins and would hit 100,000 in about a year.
NVS and wear leveling
Re: NVS and wear leveling
Assuming NVS doesn't support wear leveling (and I don't believe it does), have you considered saving your data as records in one or more SPIFFS or FATFS files which do support wear leveling? It doesn't feel like it would be that difficult to create a wrapping API that would look/behave just like NVS but instead use a file system to hold your data.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: NVS and wear leveling
NVS keeps key-value pairs in a log-based structure, which works well for minimizing flash wear. It works best when you use small values, i.e. 8-64 bit integers. For blobs and strings, especially large ones (1k and above), performance is worse.
With integers, you can expect one flash sector to be erased once per every 125 updates of a value in key-value pair.
With integers, you can expect one flash sector to be erased once per every 125 updates of a value in key-value pair.
Who is online
Users browsing this forum: No registered users and 75 guests