In the esp 32 bluetooth, What is the NVS when doing nvs_flash_init()?
In the context of the ESP32 and its Bluetooth capabilities, NVS stands for Non-Volatile Storage.
When you call nvs_flash_init(), you're essentially initializing the NVS system on the ESP32.
Non-Volatile Storage is a way to store data that needs to persist across reboots and power cycles; in other words, it doesn't get wiped when the device loses power or is restarted.
The NVS system is crucial for many applications, including storing configuration settings, saving user preferences, or keeping track of important data that needs to be retained between sessions.
For Bluetooth applications, this could include device pairing information, security keys, or custom configuration parameters that ensure the Bluetooth module operates correctly after each reboot.
Initializing the NVS with nvs_flash_init() is often one of the first steps in a program that uses NVS, as it prepares the storage system to be read from and written to. If this step is not performed, attempts to access the NVS might result in errors, as the storage system hasn't been set up properly.
In summary, nvs_flash_init() prepares the ESP32's Non-Volatile Storage system for use, allowing data to be safely stored and retained across device restarts and power losses, which is essential for maintaining stateful information like Bluetooth settings and pairings.
'MCU > ESP32' 카테고리의 다른 글
ESP-IDF: idf.py --ccache build (1) | 2024.05.01 |
---|---|
Bluetooth: GATT Server vs Client (0) | 2024.04.27 |
ESP32: RTC and Low power mode (0) | 2024.04.19 |
ESP32: ESP-BLE-MESH # Bluetooth (0) | 2024.04.11 |
ESP32 - ESP IDF # monitor (0) | 2024.03.21 |