NVS not initialized error

dennis.kim
Posts: 1
Joined: Fri Feb 05, 2021 10:38 am

NVS not initialized error

Postby dennis.kim » Fri Feb 25, 2022 12:51 pm

Hi,

Checking BLE execution by running ble_compatibility_test(\examples\bluetooth\bluedroid\ble\ble_compatibility_test) example code with ESP32-WROOM-32U.
When executing the code, an NVS initialization error occurs as shown below.

--- idf_monitor on com38 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
init: At 3FFC5F00 len 0001A100 (104 KiB): DRAM
I (468) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (475) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (481) heap_init: At 40096BE4 len 0000941C (37 KiB): IRAM
I (488) spi_flash: detected chip: generic
I (492) spi_flash: flash io: dio
I (497) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1028) BTDM_INIT: BT controller compile version [bfbbe1e]
I (1028) system_api: Base MAC address is not set
I (1028) system_api: read default base MAC address from EFUSE
I (1038) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
E (1048) phy_init: esp_phy_load_cal_data_from_nvs: NVS has not been initialized. Call nvs_flash_init before starting WiFi/BT.
W (1058) phy_init: failed to load RF calibration data (0x1101), falling back to full calibration
E (1448) BT_OSI: config_new: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
W (1448) BT_BTC: btc_config_init unable to load config file; starting unconfigured.

E (1458) BT_OSI: config_save: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
E (1458) BT_OSI: config_save, err_code: 0x2

E (1548) BT_OSI: config_save: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
E (1548) BT_OSI: config_save, err_code: 0x2

E (1558) BT_OSI: config_save: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
E (1568) BT_OSI: config_save, err_code: 0x2

E (1568) BT_OSI: config_save: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
E (1578) BT_OSI: config_save, err_code: 0x2

E (1588) BT_OSI: config_save: NVS not initialized. Call nvs_flash_init before initializing bluetooth.
E (1598) BT_OSI: config_save, err_code: 0x2


I (1608) BLE_COMP: create attribute table successfully, the number handle = 11

I (1628) BLE_COMP: (0) ***** advertising start successfully *****

Please guide me on how to solve this error.

jesse_a_b
Posts: 4
Joined: Fri Apr 21, 2023 6:58 pm

Re: NVS not initialized error

Postby jesse_a_b » Fri Apr 28, 2023 2:03 pm

I have the same problem

jesse_a_b
Posts: 4
Joined: Fri Apr 21, 2023 6:58 pm

Re: NVS not initialized error

Postby jesse_a_b » Fri Apr 28, 2023 3:52 pm

I was able to solve a similar error based on the esp-now example project by adding this in main :

Code: Select all

    // Initialize NVS
    esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
        ESP_ERROR_CHECK( nvs_flash_erase() );
        ret = nvs_flash_init();
    }
    ESP_ERROR_CHECK( ret );

Who is online

Users browsing this forum: No registered users and 67 guests