nvs vs spiff vs wear_levelling
Posted: Sun Oct 29, 2017 8:33 pm
Hi ESP-IDF,
I love what you are working on! I've learned tons stuff from my 6€ ESP32 board. It's the most bang for each buck I've ever experienced!
Right now I'm working on a project that need to read/write some parameters from/into spi Flash:
Firstly, I'd burn some default setting parameters for my App into spi flash. After start-up, If the device can't find the file "newSetting.cfg" from sd card, it will use default setting parameters that written in spi flash. If "newSetting.cfg" did exist, it will read it, use them and update these parameters in spi flash.
Secondly, I will update device "oldmeter" (run time of hours in total) every one hour and a "power-up counter" which will be +1 for each power-up.
For both parts, "nvs" library looks pretty the thing designed for this perpose. But according to the doc, it does the job, (but not in "classical poxis way" though). But I have these worry/questions:
1. the API of nvs looks pretty handy. Does it do the Wear Leveling as well? How would it deal with dead block? It's pretty critical if I'd update the oldmeter every one hours for the long term.
2. Why there are paralle so many librarys for data storage? Are they really the same? If not, what are their emphasises?
3. Each example from "storage" folder from ESP-IDF showed the data from their different directory.
1. wear_leveling -> "./spiflash"
2. spiff -> "./spiffs"
3. nvs -> "storage"
Are these spi flash related directorys pointing to the same "nvs" named partition of the "Espressif ESP32 Partition Table"? If it is so. Are these names the "subdirectory" in partition "nvs"?
4. Has somebody the experience of spi flash with its read/write lifetime? (Abs safe I/O time)
Thanks!
I love what you are working on! I've learned tons stuff from my 6€ ESP32 board. It's the most bang for each buck I've ever experienced!
Right now I'm working on a project that need to read/write some parameters from/into spi Flash:
Firstly, I'd burn some default setting parameters for my App into spi flash. After start-up, If the device can't find the file "newSetting.cfg" from sd card, it will use default setting parameters that written in spi flash. If "newSetting.cfg" did exist, it will read it, use them and update these parameters in spi flash.
Secondly, I will update device "oldmeter" (run time of hours in total) every one hour and a "power-up counter" which will be +1 for each power-up.
For both parts, "nvs" library looks pretty the thing designed for this perpose. But according to the doc, it does the job, (but not in "classical poxis way" though). But I have these worry/questions:
1. the API of nvs looks pretty handy. Does it do the Wear Leveling as well? How would it deal with dead block? It's pretty critical if I'd update the oldmeter every one hours for the long term.
2. Why there are paralle so many librarys for data storage? Are they really the same? If not, what are their emphasises?
3. Each example from "storage" folder from ESP-IDF showed the data from their different directory.
1. wear_leveling -> "./spiflash"
2. spiff -> "./spiffs"
3. nvs -> "storage"
Are these spi flash related directorys pointing to the same "nvs" named partition of the "Espressif ESP32 Partition Table"? If it is so. Are these names the "subdirectory" in partition "nvs"?
4. Has somebody the experience of spi flash with its read/write lifetime? (Abs safe I/O time)
Thanks!