Closed chipweinberger closed 2 years ago
I tried unchecking "Store phy calibration data in NVS" (CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE) and it stil crashes at the same place.
Interestingly, I fixed the crash by lowering this from 16384 to 512.
I have abort on memory allocation enabled. But it does not trigger.
@chipweinberger If you want to disable NVS, please also make wifi_init_config_t->nvs_enable false. But I still suggest not disable NVS.
Thanks for the suggestion.
Why disable NVS? I dont want any state to be remembered. I want every boot to be the same. This is for a recovery mode. I want to remove the possibility of a boot failure caused by bad NVS state.
I could instead clear the nvs partition on during boot. And then re-initialize it. Is that better? But I dont have an NVS partition so it will take storage.
hi @chipweinberger If you think nvs has an impact on the module restart, you can erase nvs, so that WIFI will be configured with the default configuration next time, but it is not recommended to turn off nvs.
hi @chipweinberger If you think nvs has an impact on the module restart, you can erase nvs, so that WIFI will be configured with the default configuration next time, but it is not recommended to turn off nvs.
Could you explain the impact of turning off nvs for wifi?
the workaround fixed the crash for me.
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
cfg.nvs_enable = false;
And yes, why is NVS off not recommended?
HI @chipweinberger
You can turn off nvs of wifi through menuconfig.
Component config → Wi-Fi-->WiFi NVS flash
Because nvs saved the last connection parameters of wifi, such as channel, bandwidth, password, ssid, pmk and so on.
There are also some verification parameters of the physical layer that will remain in it.
When wifi is connected, the last connection parameters from nvs will be used for quick connection, which takes a short time.
commit a79dc75 (HEAD -> release/v4.4, origin/release/v4.4) Date: Thu Dec 16 10:17:56 2021 +0000
Board: ESP32-S2
Expected behavior: does full calibration without crash
I (5493) pd wifi: switching to 'Create Wifi AP Hotspot' mode I (7873) phy_init: phy_version 1800,e7ef680,Apr 13 2021,11:45:08 E (7883) phy_init: esp_phy_load_cal_data_from_nvs: NVS has not been initialized. Call nvs_flash_init before starting WiFi/BT.
@chipweinberger Maybe the problem is you didn't call nvs_flash_init before starting WiFi/BT? (see above error message)
Thanks for reporting, feel free to reopen.
commit a79dc75f0a91f4b558dcefb7ae5096c71c63e2e9 (HEAD -> release/v4.4, origin/release/v4.4) Date: Thu Dec 16 10:17:56 2021 +0000
Board: ESP32-S2
Expected behavior: does full calibration without crash