Page 1 of 1

断开WiFi之后,为啥nvs会被擦除,并且重新初始化nvs???

Posted: Fri Nov 12, 2021 7:05 am
by fst202130609
// Initialize NVS.
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
err = nvs_flash_init();
}

难道是因为这里吗????

Re: 断开WiFi之后,为啥nvs会被擦除,并且重新初始化nvs???

Posted: Fri Nov 12, 2021 7:30 am
by ESP_ICY
是的,nvs_flash_erase() 就是擦除的命令。