Code: Select all
ESP_ERR_NVS_CORRUPT_KEY_PART
Code: Select all
// find partition with nvs_keys
const esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA,
ESP_PARTITION_SUBTYPE_DATA_NVS_KEYS,
KEYS_PARTITION_LABEL);
if (partition == NULL)
{
printf("Could not locate nvs_key partition. Aborting.");
}
// read nvs_keys from key partition
nvs_sec_cfg_t cfg;
esp_err_t err = nvs_flash_read_security_cfg(partition, &cfg);
if (err != ESP_OK)
{
printf("Failed to read nvs keys. Error: %s", esp_err_to_name(err));
}
Code: Select all
nvs_flash_read_security_cfg()
here's how my partition table looks like:
Code: Select all
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0xa000,24K,
nvs_private,data,nvs,0x10000,12K,
private_keys,data,nvs_keys,0x13000,4K,
phy_init,data,phy,0x14000,4K,
factory,app,factory,0x20000,1M,