ESP_ERR_NVS_NOT_FOUND while trying to open nvs partition after provisioning

cesiumua
Posts: 1
Joined: Wed Aug 28, 2024 7:50 pm

ESP_ERR_NVS_NOT_FOUND while trying to open nvs partition after provisioning

Postby cesiumua » Wed Aug 28, 2024 7:59 pm

Hi! I've been running a mqtt ssl_ds example app, which describes how to provision a device with certificate and key to be used for secure connection with MQTT. I'm able to provision a board, and it connects successfully to a secured MQTT broker, but, if I modify that example project to write some data to NVS storage, I'm always getting an error 0x1102 (ESP_ERR_NVS_NOT_FOUND).
I see this fail while trying to open a storage:

Code: Select all

err = nvs_open("storage", NVS_READONLY, &nvs_handle);
. I've seen somewhere that this error could be due to storage was not initialized, but if I change

Code: Select all

NVS_READONLY
to

Code: Select all

NVS_READWRITE
in

Code: Select all

nvs_open
function, seems like it erases previously provisioned certificate/key, as I'm getting an error that they could not be loaded during MQTT connection process.
The example comes with partitions.csv:

Code: Select all

# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
esp_secure_cert,0x3F,,,0x2000,
nvs,data,nvs,,24K,
phy_init,data,phy,,4K,
factory,app,factory,0x20000,1M,
but I can't figure out, if some modifications are required here or not, in order to make nvs_open to work
So, how could I fix this error?
Thanks in advance!

RathiSonika
Posts: 11
Joined: Thu Jun 22, 2023 2:58 pm

Re: ESP_ERR_NVS_NOT_FOUND while trying to open nvs partition after provisioning

Postby RathiSonika » Mon Sep 02, 2024 11:02 am

Hi, the issue isn't fully clear based on the current description. Could you please share your custom or modified code to help us better understand the issue?

Who is online

Users browsing this forum: Bing [Bot], MTRobin and 68 guests