4813ab2d28
nvs_flash_init may return an error code in some cases, and applications should check this error code (or at least assert on it being ESP_OK, to make potential issues more immediately obvious). This change modifies all the examples which use NVS to check the error code. Most examples get a simple ESP_ERROR_CHECK assert, while NVS examples, OTA example, and NVS unit tests get a more verbose check which may be used in real applications. |
||
---|---|---|
.. | ||
main | ||
Makefile | ||
README.md |
Non-Volatile Storage (NVS) Read and Write Example
Demonstrates how to read and write a single integer value using NVS.
The value holds the number of ESP32 module restarts. Since it is written to NVS, the value is preserved between restarts.
Example also shows how to check if read / write operation was successful, or certain value is not initialized in NVS. Diagnostic is provided in plain text to help track program flow and capture any issues on the way.
Check another example storage/nvs_rw_blob, that shows how to read and write variable length binary data (blob).
Detailed functional description of NVS and API is provided in documentation.
See the README.md file in the upper level 'examples' directory for more information about examples.