- esp_err_t ret = nvs_open("myNamespace", NVS_READWRITE, &handle);
- if(ret != 0){
- ESP_LOGE(TAG, "Failed to open myNamespace namespace.");
- goto other_task;
- }
nvs_open and nvs_get work from namespaces that do not exist.
nvs_open and nvs_get work from namespaces that do not exist.
I have a few devices that have different namespaces and partitions within their nvs storage to store different values, but share the same code. In my code, I have made exceptions for when a specific namespace does not exist:
However the devices that I know for sure that do not have this specific namespace within their partition return no error, and reads garbage values whenever I try to read the data inside the keys from within this namespace. What is happening here? Will the device always open namespaces that do not exist within the device? I made the NVS partition namespaces using nvs_partition_gen.py and parttool.py
Re: nvs_open and nvs_get work from namespaces that do not exist.
Hard to say what's going on without seeing the input to nvs_partition_gen.py and parttool.py for each device but nvs_open WILL create a namespace if it doesn't already exist and if it was called with NVS_READWRITE. When you say "reads garbage values" are you saying that the read returns ESP_OK when it should return a failure code?
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot], Google Adsense [Bot] and 73 guests