NVS set the same value as stored in nvs partition
Posted: Thu Sep 10, 2020 1:51 pm
Hello,
I'm working on ESP-IDF v4.0.1
I would like to know what happens if I call nvs_set_* and I already have got the same value stored in my nvs partition ?
In my code, I don't know if I need to check the previous value stored before storing a new one and I don't find a good information into the docs.
I found the followings information in https://docs.espressif.com/projects/esp ... flash.html:
and https://docs.espressif.com/projects/esp ... alue-pairs :
but I still don't know the answer after, can someone help me ?
I'm working on ESP-IDF v4.0.1
I would like to know what happens if I call nvs_set_* and I already have got the same value stored in my nvs partition ?
In my code, I don't know if I need to check the previous value stored before storing a new one and I don't find a good information into the docs.
I found the followings information in https://docs.espressif.com/projects/esp ... flash.html:
Keys are required to be unique. Assigning a new value to an existing key works as follows:
- if the new value is of the same type as the old one, value is updated
- if the new value has a different data type, an error is returned
and https://docs.espressif.com/projects/esp ... alue-pairs :
Log of key-value pairs
NVS stores key-value pairs sequentially, with new key-value pairs being added at the end. When a value of any given key has to be updated, a new key-value pair is added at the end of the log and the old key-value pair is marked as erased.
but I still don't know the answer after, can someone help me ?