]> granicus.if.org Git - esp-idf/commit
Merge branch 'bugfix/nvs_init_check_empty_pages' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 23 Mar 2017 09:57:15 +0000 (17:57 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 23 Mar 2017 09:57:15 +0000 (17:57 +0800)
commitecee17596275c5f46bbeacb25b156f277d178164
tree1665a9406a9ec0520ecf6b5793a2a61cb7b7216b
parent0f1109a9a246fde30cdd8fdbdc0194ac73193a2a
parent447ffb23d5b441e9836a63d7798fd3ab6a0fc495
Merge branch 'bugfix/nvs_init_check_empty_pages' into 'master'

Error handling in NVS initialization

Previously nvs_flash_init worked under an assumption that there should always be at least one free page available. This is true during normal operation, but in some cases (such as when changing application partition table from a non-OTA to an OTA one), NVS partition may get truncated, which will cause empty pages to be lost.

This MR adds error checks for this condition, and updates code which calls `nvs_flash_init` to check for the return code.
For most examples, a simple `ESP_ERROR_CHECK` is added around `nvs_flash_init`. For NVS examples and the OTA example, more robust error handling is added.

This change also removes nvs_flash_init calls from examples which don't use NVS.

See merge request !582