Commit graph

139 commits

Author SHA1 Message Date
Ivan Grokhotkov
dae40f4ff1 nvs: add a blob fragmentation test case
Ref. TW12937
2019-02-26 01:58:20 +00:00
Ivan Grokhotkov
02a76abb8b nvs: do eager cleanup of HashListBlocks
Previously when HashList was removing items, HashListBlocks were
removed lazily. This resulted in empty HashListBlocks dangling around
in full pages, even when all items have been erased. These blocks
would only be deleted when NVS was re-initialized
(nvs_flash_deinit/nvs_flash_init).

This change does eager cleanup instead, based on the code from
@negativekelvin offered in
https://github.com/espressif/esp-idf/issues/1642#issuecomment-367227994.

Closes https://github.com/espressif/esp-idf/issues/1642.
2019-02-26 01:58:20 +00:00
Sagar Bijwe
d32128440d nvs_flash: Detect key partition as uninitialised even if encrypted by bootloader
Currently, only erase operation performed by the application leads
to detection of NVS key partition as uninitialised. This change
adds additional checks for detecting partition as uninitialised,
when device boots first time right after encryption by bootloader.
2019-02-01 13:28:13 +05:30
Roland Dobai
37126d3451 Correct Kconfigs according to the coding style 2019-01-29 13:37:01 +01:00
Gautier Seidel
b4c4f8514b nvs_flash: Improve nvs_flash_init_partition() speed
Signed-off-by: Sagar Bijwe <sagar@espressif.com>
2019-01-23 04:53:36 +00:00
Martin Válik
602d102403 Added support for NVS in console example 2019-01-11 09:51:50 +08:00
Sagar Bijwe
fc37dc1944 nvs_flash: Fix compilation of host testcases when g++-8.x is used.
When std::bind is used, it requires inclusion of <functional> header.
This was not mandatory with earlier versions of g++ (4.x), may be because they
had experimental support for c++11.
2018-12-07 09:40:45 +00:00
Shivani Tipnis
0c72b08872 nvs_util: update test case 2018-11-21 13:40:24 +05:30
Shivani Tipnis
582c547191 Update README 2018-11-21 12:55:47 +05:30
Shivani Tipnis
c44f15441f Closes https://github.com/espressif/esp-idf/issues/2472 2018-11-21 12:55:47 +05:30
Shivani Tipnis
9db1987892 nvs_util: Add changes to nvs part gen util
nvs_util: Add changes to nvs part gen util

nvs_host_test: Add test case for keygen and keyfile paratmeters
2018-11-21 12:55:47 +05:30
Ivan Grokhotkov
6091021e83 unity: separate common and IDF specific functionality
New unity component can be used for testing other applications.
Upstream version of Unity is included as a submodule.
Utilities specific to ESP-IDF unit tests (partitions, leak checking
setup/teardown functions, etc) are kept only in unit-test-app.
Kconfig options are added to allow disabling certain Unity features.
2018-11-19 12:36:31 +08:00
Renz Bagaporo
cc774111bf cmake: Add support for test build 2018-10-20 12:07:24 +08:00
Shivani Tipnis
7c08fcccaf util: Update docs as per review comments 2018-10-12 11:04:49 +05:30
Shivani Tipnis
5bee9faf49 tools: Add Python2 and Python3 compatibility support to nvs util tool and mfg tool 2018-10-12 11:04:49 +05:30
Shivani Tipnis
1d38d8a17f nvs_util: Add Python2 and Python3 compatible 2018-10-12 11:04:49 +05:30
Shivani Tipnis
0f6bcec2bc nvs_part_gen: Add changes to partition size input 2018-10-12 11:04:49 +05:30
Shivani Tipnis
60df21115e nvs_part_gen: Update to make python version compatible
(cherry picked from commit 3506b2d60792e5d4ed4f744b28f2da6733c6aae7)
2018-10-12 11:04:49 +05:30
Shivani Tipnis
1460f03065 nvs_util: Add Python2 and Python3 compatible 2018-10-12 11:04:49 +05:30
Shivani Tipnis
fb31788504 nvs_part_gen: Add changes to partition size input 2018-10-12 11:04:49 +05:30
Shivani Tipnis
4bc87a414f nvs_part_gen: Update to make python version compatible
(cherry picked from commit 3506b2d60792e5d4ed4f744b28f2da6733c6aae7)
2018-10-12 11:04:49 +05:30
Sagar Bijwe
454b69d2ea nvs_flash: Update documentation at different places to indicate NVS encryotion is supported 2018-10-05 14:05:21 +05:30
Angus Gratton
a4aadd1926 Merge branch 'feature/nvs_encryption' into 'master'
nvs_flash: Add support for nvs encryption

See merge request idf/esp-idf!2700
2018-09-25 08:15:55 +08:00
Shivani Tipnis
7c1360b10a nvs_util: Fix multipage blob data format generate 2018-09-24 15:44:31 +05:30
Sagar Bijwe
48fccbf5dd nvs_flash: Add support for nvs encryption 2018-09-24 11:25:21 +05:30
Angus Gratton
4d50427e87 Merge branch 'feature/nvs_util_backport' into 'master'
nvs_util: Add changes for utility to support old and new multipage blob

See merge request idf/esp-idf!3270
2018-09-24 11:53:29 +08:00
Shivani Tipnis
ca3acef82c nvs_util: Add support for old and new multipage blob 2018-09-19 22:00:08 +05:30
Roland Dobai
7183112cc4 nvs_flash: fix division for Python 2 & 3 2018-09-17 16:01:54 +02:00
Renz Christian Bagaporo
d9939cedd9 cmake: make main a component again 2018-09-11 09:44:12 +08:00
Angus Gratton
cff2ef695a Merge branch 'master' into feature/cmake 2018-09-06 20:23:04 +08:00
Sagar Bijwe
db7c257f33 nvs_flash: Minor changes to NVS documentation
1) Change API doc to reflect new limits on string and blob length.
2) Add "version" field to Page Header structure in README.

Fixes: https://github.com/espressif/esp-idf/issues/2321
2018-09-04 18:51:31 +05:30
Angus Gratton
a9c4ed7139 Merge branch 'master' into feature/cmake 2018-08-30 18:51:01 +08:00
Sagar Bijwe
911f96ad21 nvs_flash: Fix nvs_set_blob hang when partition is near to FULL
Marking a page full does not skip it from page selection process and the
same page might get returned if there is no other page with more unused
entries. Added a check for the same while storing blobs.

Fixes: https://github.com/espressif/esp-idf/issues/2313
2018-08-21 17:08:46 +05:30
Angus Gratton
3012b0f887 Merge branch 'feature/nvs_multi_page_util' into 'master'
Bugfix: multi page blob creation was failing if only one entry was left in page

See merge request idf/esp-idf!2971
2018-08-16 15:23:11 +08:00
Angus Gratton
ff2404a272 Merge branch 'master' into feature/cmake 2018-08-16 17:14:17 +10:00
Shivani Tipnis
dfde105f25 Add support for input custom partition size 2018-08-16 11:54:46 +05:30
Shivani Tipnis
5ce40fce0c Add nvs part gen utility multi page blob support update 2018-08-16 11:46:25 +05:30
Ivan Grokhotkov
5fc6397589 nvs: fix memory leak when writing a blob
Introduced in 5a27a63.
Clear usedPages list in all exit conditions, add test.
2018-08-09 10:35:19 +03:00
Sagar Bijwe
1df85e0039 nvs_flash: Version compatibility check for nvs storage
This change adds a check for compatibility between the nvs version
found on nvs flash and the one assumed by running code during nvs
initialization. Any mismatch is reported to the user using new error
code ESP_ERR_NVS_NEW_VERSION_FOUND.
2018-08-05 00:00:56 +00:00
Sagar Bijwe
8ef7a49cc3 nvs_flash: Bump up nvs version 2018-08-05 00:00:56 +00:00
Sagar Bijwe
5a27a63541 nvs-flash: Support for blobs larger than half of SPI Flash sector size
This change removes the earlier limitation of 1984 bytes for storing data-blobs.
Blobs larger than the sector size are split and stored on multiple sectors.
For this purpose, two new datatypes (multi-page index and multi-page data) are
added for entries stored in the sectors. The underlying read, write, erase and find
operations are modified to support these large blobs. The change is transparent
to users of the library and no special APIs need to be used to store these large
blobs.
2018-07-20 00:13:15 +05:30
Piyush Shah
e7ddd47716 nvs_partition_generator: Add support for base64 representation of Binary data 2018-07-02 15:40:21 +05:30
Piyush Shah
8369bd244b nvs_partition_generator: Modifications to enable using the utility as a Python library
And also use directly as an executable
2018-07-02 15:39:52 +05:30
Ivan Grokhotkov
d9f8311b9d docs: add error codes reference 2018-06-15 15:49:24 +08:00
Paul Reimer
c83c3b64cd Add declarations of private nvs functions (nvs_*) in nvs_flash component to fix C++ -Wmissing-declarations warning
Merges https://github.com/espressif/esp-idf/pull/1956
2018-06-04 16:36:44 +10:00
Roland Dobai
07acbb5664 ESP_ERROR_CHECK converts error code to text
If CONFIG_ESP_ERR_TO_NAME_LOOKUP is enabled, ESP_ERROR_CHECK
prints error message in addition to the error code.
2018-05-31 12:53:37 +02:00
Angus Gratton
6b9784cc45 Merge branch 'master' into feature/cmake_update 2018-05-31 14:46:23 +10:00
Ivan Grokhotkov
cb649e452f remove executable permission from source files 2018-05-29 20:07:45 +08:00
Angus Gratton
3d92c6cccd nvs README: Remove section about encryption capability 2018-05-15 18:02:28 +08:00
Ivan Grokhotkov
73ec743a0a Merge branch 'bugfix/nvs_page_compaction' into 'master'
nvs: Fix recovery from power-off while page is being freed

See merge request idf/esp-idf!2327
2018-05-07 09:08:23 +08:00