mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-10 00:42:48 +00:00
Merge branch 'feature/nvs_version_check_v3.1' into 'release/v3.1'
nvs_flash: Version compatibility check for nvs storage (backport 3.1) See merge request idf/esp-idf!2958
This commit is contained in:
@@ -157,6 +157,11 @@ static const esp_err_msg_t esp_err_msg_table[] = {
|
||||
# ifdef ESP_ERR_NVS_PART_NOT_FOUND
|
||||
ERR_TBL_IT(ESP_ERR_NVS_PART_NOT_FOUND), /* 4367 0x110f Partition with specified name is not found
|
||||
in the partition table */
|
||||
# endif
|
||||
# ifdef ESP_ERR_NVS_NEW_VERSION_FOUND
|
||||
ERR_TBL_IT(ESP_ERR_NVS_NEW_VERSION_FOUND), /* 4368 0x1110 NVS partition contains data in new format
|
||||
and cannot be recognized by this version of
|
||||
code */
|
||||
# endif
|
||||
// components/ulp/include/esp32/ulp.h
|
||||
# ifdef ESP_ERR_ULP_BASE
|
||||
|
@@ -83,8 +83,8 @@ TEST_CASE("wifi stop and deinit","[wifi]")
|
||||
//init nvs
|
||||
ESP_LOGI(TAG, EMPH_STR("nvs_flash_init"));
|
||||
esp_err_t r = nvs_flash_init();
|
||||
if (r == ESP_ERR_NVS_NO_FREE_PAGES) {
|
||||
ESP_LOGI(TAG, EMPH_STR("no free pages, erase.."));
|
||||
if (r == ESP_ERR_NVS_NO_FREE_PAGES || r == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
ESP_LOGI(TAG, EMPH_STR("no free pages or nvs version mismatch, erase.."));
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
r = nvs_flash_init();
|
||||
}
|
||||
|
Reference in New Issue
Block a user