The description doesn't exactly look correct, but "not found" sounds right. I opened it READ/WRITE, even though I'm only wanting to read it right now...#define ESP_ERR_NVS_NOT_FOUND (ESP_ERR_NVS_BASE + 0x02) /*!< Id namespace doesn’t exist yet and mode is NVS_READONLY */
However, after writing the bin file I created with the partition generator, I get the following error return on calling nvs_flash_init_partition....nvs_open_from_partition(nvs_partition, l_nvs_tag, NVS_READWRITE, &l_nvs)
I tried specifying version v1 with the generator and it fails with the following message....#define ESP_ERR_NVS_NEW_VERSION_FOUND (ESP_ERR_NVS_BASE + 0x10) /*!< NVS partition contains data in new format and cannot be recognized by this version of code */
So, I'm stumped on how to create a valid partition file. This is my csv file....OTA: Size exceeds max allowed length.
The pem files are all text, so I'm wondering if it would be better to read them as string instead of blob. I.E. nvs_get_blob or nvs_get_str? But I need to get past the init and open first.key,type,encoding,value
CERTS,namespace,,
OTA,file,string,myota.pem
PNUB,file,string,mypn.pem
BEND,file,string,mybe.pem
This is my partition file....
And this is the esptool write command, where nvscerts.bin is created with the generator....# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 2M,
storage, data, spiffs, 0x210000, 0x80000,
secstore, data, nvs, 0x290000, 0x70000,
ota_0, 0, ota_0, 0x400000, 2M,
ota_1, 0, ota_1, 0x600000, 2M,
And the generator command....$ python $IDF_PATH/components/esptool_py/esptool/esptool.py --port com16 write_flash 0x290000 nvscerts.bin
I copied nvs_partition_gen.py to my local direction from v3.1.3 directory because it couldn't find my pem files unless they are in the directory of the "py" file.$ python nvs_partition_gen.py --version v2 nvscerts.csv nvscerts.bin
In the code "nvs_partition" is "secstore", which is the name in the partition file. And "l_nvs_tag" is "CERTS", which is the namespace in the CSV file.
John Anvs_flash_init_partition(nvs_partition)
nvs_open_from_partition(nvs_partition, l_nvs_tag, NVS_READWRITE, &l_nvs)