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

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

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

Postby fst202130609 » Fri Nov 12, 2021 7:05 am

// 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();
}

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

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

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

Postby ESP_ICY » Fri Nov 12, 2021 7:30 am

是的,nvs_flash_erase() 就是擦除的命令。

Who is online

Users browsing this forum: No registered users and 44 guests