Page 1 of 1

用按键来重启 esp_restart();导致nvs读取不了数据?还导致了复位?

Posted: Fri Dec 10, 2021 9:02 am
by fst202130609
if((KEY_KEY_READ ==KEY_LONG_PRES)&&(KEY_UP ==0))
{
printf("key2 long down\r\n");
KEY_KEY_READ = NO_KEY_PRES;
ESP_ERROR_CHECK(nvs_flash_erase());
nvs_flash_init();
esp_restart();
}

导致nvs_get_str(wificfg_nvs_handler,"wifi_ssid",wifi_ssid,&len)出现异常错误,abort() was called at PC 0x4038480d on core 0