10 Commits

Author SHA1 Message Date
cca13e0f99 feat(make): Sync code from esp-idf and modify for ESP8266
Commit ID: f6bfe13e
2019-05-16 16:22:11 +08:00
3d2bd0cce0 feature/nvs_partition_gen_utility: Changes to make nvs_partition_gen_utility compatible with ESP8266.
Changes:
Removed version, keygen, encrypt, keyfile options from help.
Updated README.md accordingly
2019-02-22 00:40:43 +05:30
0eae336342 feature/nvs_partition_gen_utility: Added the nvs_partition_gen_utility from idf. 2019-02-20 15:56:17 +05:30
b83c3a0c4d fix(nvs_flash): Fix recovery from power-off while page is being freed
Currently when page is being freed, items are individually moved from
FREEING page to ACTIVE page and erased. If power-off happens during the
process, the remaining entries are moved to ACTIVE page during recovery.
The problem with this approach is there may not be enough space on
ACTIVE page for all items if an item was partially written before
power-off and erased during recovery. This change moves all the items
from FREEING to ACTIVE page and then erased the FREEING page, If
power-off happens during the process, then ACTIVE page is erased and the
process is restarted.

esp-idf commit ID: 7ae1df1c
2019-01-22 11:55:20 +08:00
e5c9b74005 fix(nvs_flash): don’t expect items with bad CRC to be in cache
When erasing a variable length item with an incorrect CRC32, the span
value of the item can not be trusted, so the item will be erased with
span = 1. Subsequent entries represent the data of the variable
length item, and these will be treated as separate items. For each
entry CRC32 is checked, the check most likely fails (because the
entry contains arbitrary data, and not a proper NVS item), and the
entry is erased. Erase function assumed that every item should be
present in cache, but it is not the case for the entries which are
just parts of item’s payload. This change allows for the item to be
not found in the hashlist, if the CRC32 check fails.

esp-idf commit ID: 2c3644a0
2019-01-22 11:55:20 +08:00
ab9b141953 fis(nvs_flash): Fix recovery after power-off during erase operation
Current code for recovery after power-off do not clean-up partially
erased items for FULL pages. If the erasure was part of modification
operation, this gets luckily cleaned-up because of duplicate detection
logic. For erase-only operation, the problem still exists. This patch
adds the recovery for FULL pages also.

esp-idf commit ID: 9a3c4b71
2019-01-22 11:55:20 +08:00
1837a115bb fix(nv_flash): Fix page selection algo to consider free entry counts as well
Current page selection algorithm selects a page for compaction based on just erased counts
and gives up when it does not find any page with erased count greater than 0. This is
problematic since the current allocation procedure skips the active page if there is not
enough room for the item in that page leaving free chunks on the pages. This change modifies
the algorithm to consider both erased as well as free counts on the candidate pages.

esp-idf commit ID: 7e79471e
2019-01-22 11:21:58 +08:00
b1a9eccf28 feat(nvs_flash): Add CRC32 for NVS 2018-06-08 19:46:09 +08:00
eae39b7cfe feat(nvs_flash): Bring NVS flash component from esp-idf
Commit ID: c2b39f4a
2018-06-08 19:46:09 +08:00
455eeb7499 feat(nvs_flash): Bring nvs_flash header file from esp-idf
Add empty function just to pass compiling.
2018-06-01 12:46:19 +08:00