I'm totally confused about how to manage an extra NVS partition .
As far as I understand the documentation , THE NVS partition (the main one) is not encrypted , So I initialize it with
Code: Select all
nvs_flash_init(); // only for the main NVS even if Flash encryption is enabled
Now my other NVS partition is inited as
Code: Select all
nvs_sec_cfg_t xts_cfg;
nvs_handle_t my_handle;
esp_err_t ret;
key_part = esp_partition_find_first(
ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS_KEYS, NULL);
ret = nvs_flash_read_security_cfg(key_part, &xts_cfg);
ret = nvs_flash_secure_init(&xts_cfg);
//I try this
ret = nvs_open_from_partition(key_part->label, "Partition_Saved_Keys", NVS_READONLY, &my_handle);
// or this
ret = nvs_open("Partition_Saved_Keys", NVS_READONLY, &my_handle);
// but they always fail .
https://github.com/espressif/esp-idf/bl ... #L311-L384
but I don't get what is happening there .
My flash encryption mode is Development and before enabling flash encryption .. everything was fine
I just don't know how to init the extra NVS partition after flash encryption is enabled .
Is there any code that describes how to handle this in a real situation ? not a Test Case ?
Thank You