E (5717176) nvs: Failed to read NVS security cfg: [0x1117] (ESP_ERR_NVS_CORRUPT_KEY_PART)

woochang
Posts: 3
Joined: Wed Oct 18, 2023 8:44 am

E (5717176) nvs: Failed to read NVS security cfg: [0x1117] (ESP_ERR_NVS_CORRUPT_KEY_PART)

Postby woochang » Wed Oct 18, 2023 10:21 am

Hello, Everyone
My development environment is esp-idf 4.3 & ESP32.
Flash encryption was applied, but secure boot was not applied.
I downloaded the program to UART using “idf.py encrypted-flash monitor”.
An error occurs when you run the code below to run ota.
void ota_nvs_flash_init()
{
// Initialize NVS.
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES) {
// OTA app partition table has a smaller NVS partition size than the non-OTA
// partition table. This size mismatch may cause NVS initialization to fail.
// If this happens, we erase NVS partition and initialize NVS again.
ESP_ERROR_CHECK(nvs_flash_erase());
err = nvs_flash_init();
}
ESP_ERROR_CHECK( err );
}

The contents of the error are as follows:
E (5717176) nvs: Failed to read NVS security cfg: [0x1117] (ESP_ERR_NVS_CORRUPT_KEY_PART)
ESP_ERROR_CHECK failed: esp_err_t 0x1117 (ESP_ERR_NVS_CORRUPT_KEY_PART) at 0x400869f4
0x400869f4: _esp_error_check_failed at /home/hgwc/st-device-sdk-c-ref/bsp/esp32/components/esp_common/src/esp_err.c:41

Attaching the booting message, sdkconfig and partition table.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 113 guests