Commit Graph

321 Commits

Author SHA1 Message Date
radek.tandler
f693b78f93 feature(nvs_flash) : added support iteration over namespace by index - review changes 2023-08-29 16:05:02 +02:00
Ivan Grokhotkov
92ff04ebea nvs: use 'handle' argument name for consistency 2023-08-29 13:59:34 +02:00
Cody P Schafer
f2af1c5305 nvs: support iteration over namespace by index
Users of the nvs API are likely to have `nvs_handle_t` in all cases, but
not all of them carry around the partition name and namespace name (as
they aren't needed after creating an `nvs_handle_t`).

Allow this common case to use nvs iteration without them tracking
additional data by using the `nvs_handle_t` to locate the namespace
index and the partition name by introducing an alterate to
`nvs_entry_find` called `nvs_entry_find_in_handle`, which operates
similarly except that it is given a `nvs_handle_t` instead of partition
and namespace strings.

This is somewhat more limited than the `nvs_entry_find` API as one
cannot examine all keys in a given partition.
2023-08-29 13:59:34 +02:00
Martin Vychodil
e44d4260ad Merge branch 'feature/storage_host_test_nvs_flash2' into 'master'
nvs_flash: finished migration of host tests to the linux emulator of esp_partition

See merge request espressif/esp-idf!23926
2023-08-28 20:20:16 +08:00
Armando
7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
Adam Múdry
42ac85a6a1 Merge branch 'contrib/github_pr_11926' into 'master'
Support NVS image generation from CMake (GitHub PR)

Closes IDFGH-10702 and IDFGH-10542

See merge request espressif/esp-idf!25102
2023-08-15 00:20:11 +08:00
radek.tandler
28f82d8de7 refactor(nvs_flash): Host test migrated to esp_partition emulation for linux 2023-08-09 14:14:21 +02:00
radek.tandler
3ffb8f8ffd nvs: nvs_get_stats fixed test, improved comment 2023-08-08 08:43:19 +02:00
radek.tandler
ac6c03fad1 change(nvs_flash): nvs_get_stats extended, API documentation improved 2023-08-08 08:43:19 +02:00
Vincent Hamp
d975a26666 feat: Add support for NVS image generation from CMake
Closes: https://github.com/espressif/esp-idf/pull/11926
Closes: https://github.com/espressif/esp-idf/pull/11785

Co-authored-by: Nebojša Cvetković <nebkat@gmail.com>
2023-07-31 18:26:06 +02:00
Wang Zi Yan
3e4152cdcf docs: Update CN for nvs_flash.rst and flash-encryption.rst 2023-07-14 04:05:53 +00:00
Adam Múdry
098cab35e4 NVS: nvs_tool.py entry.data None check fix 2023-06-21 11:23:22 +02:00
KonstantinKondrashov
e72061695e all: Removes unnecessary newline character in logs
Closes https://github.com/espressif/esp-idf/issues/11465
2023-06-09 03:31:21 +08:00
Laukik Hase
72f703ccd4
nvs_flash: Extended test-app and host tests for the HMAC-based NVS encr-keys protection scheme 2023-05-23 13:55:59 +05:30
Laukik Hase
a06118012e
docs: Update nvs_flash docs for the HMAC-based NVS encr-keys protection scheme
- Also updated the `nvs_partition_generator` and `mass_mfg` tools
  documentation
2023-05-23 13:55:57 +05:30
Laukik Hase
9ac87fcc8b
nvs_partition_gen/mass_mfg: Support for HMAC-based scheme for generating NVS encr-keys 2023-05-23 13:55:55 +05:30
Laukik Hase
c1bed366ba
nvs_flash: Add support for HMAC-based NVS encryption keys protection scheme
- This features allows the NVS encryption keys to be derived and protected using
  the HMAC peripheral. Since the encryption keys are derived at runtime, they
  are not stored anywhere in the flash and hence this feature does not require
  a separate `nvs_keys` partition.
2023-05-23 13:55:52 +05:30
Linda
65ee4992ce docs: update the algorithm and key name from AES-XTS to XTS-AES 2023-05-15 17:54:50 +08:00
Laukik Hase
4ac95a33fd
nvs_flash: Migrate UTs to component test-apps 2023-04-26 10:21:03 +05:30
Ivan Grokhotkov
2a28061eaa Merge branch 'contrib/github_pr_11117' into 'master'
test_nvs_host: fix asan reported bugs (GitHub PR)

Closes IDFGH-9860

See merge request espressif/esp-idf!23172
2023-04-20 22:37:42 +08:00
Ivan Grokhotkov
f64ac33554
nvs: fix string/blob comparison lengths in host tests 2023-04-18 08:02:38 +02:00
Cody P Schafer
cbe906e53c
nvs_host_test: replace sprintf with snprintf
With some libc impls (ie: Xcode 13.1), sprintf is marked as deprecated
and causes the build with `-Werror` to fail. Switch the `sprintf` usage
in test_nvs.cpp to use `snprintf` to allow builds to complete without
warning.
2023-04-03 16:33:57 -04:00
Cody P Schafer
630343e4b9
test_nvs_host: fix asan reported bugs
- Use of `sizeof(uint32_t *)` instead of `sizeof(uint32_t)` in
   arguments
 - Use of `memcmp` without checking that length agreed (add `memeq`)
2023-04-03 16:30:02 -04:00
Jakob Hasse
bed81f450d ci(nvs_flash): Increase timeout of nvs_page_test
* nvs_page_test runs into timeout in CI. According to log,
  test ran run around halfway, so increasing from 10 to 90 seconds.

* Also increased timeout of nvs_host_test, just to be sure
2023-02-13 12:35:52 +08:00
Martin Vychodil
a2b0068478 Merge branch 'bugfix/linux_build_errors' into 'master'
fix(linux): fix build errors without --skip-setting-flags

See merge request espressif/esp-idf!22063
2023-01-20 14:46:36 +08:00
Ivan Grokhotkov
cef0744299 Merge branch 'bugfix/linux_target_gen_partition_table' into 'master'
multiple fixes for linux target

Closes IDF-6641

See merge request espressif/esp-idf!21993
2023-01-18 11:57:08 +08:00
Jakob Hasse
9991862a10 fix(linux): fix build errors and warnings, remove ignore file 2023-01-18 09:24:28 +08:00
Fu Hanxi
b02687a6c4 test: migrate linux target host test jobs into pytest-embedded 2023-01-16 10:25:55 +08:00
Ivan Grokhotkov
e7540dbe0e
docs: remove the outdated "IDF monitor doesn't work on linux" notes 2023-01-13 08:14:56 +01:00
Ivan Grokhotkov
ec8f38c9da
build system: generate the partition table by default for linux target
This fixes the issue that "idf.py partition-table" had to be run
manually in order for the partition table to be generated, when
building for linux target.
2023-01-13 08:14:56 +01:00
Marius Vikhammer
7f0aa7b534 docs: updated path to nvs_tool.py in chinese doc. 2023-01-06 11:00:17 +08:00
Ivan Grokhotkov
61c5fc21e1
docs: fix nvs-related docs build issue 2023-01-05 09:28:57 +01:00
Adam Múdry
40d1eff2bd Merge branch 'feature/nvs_tool_refinement' into 'master'
nvs: Partition tool refinement

Closes IDF-6061

See merge request espressif/esp-idf!20683
2023-01-05 06:39:01 +08:00
mofeifei
0fc2fbe83f docs: update cn trans nvs_partition_tool/readme 2023-01-04 18:32:30 +01:00
Adam Múdry
87bdcc89d0 nvs: NVS tool refinement
add: JSON output
add: integrity check - correct number of free pages check
change: split to separate files
2023-01-04 12:44:22 +01:00
Jakob Hasse
e6ca481623 bugfix(nvs_flash): fixed potential memory leak in nvs::Storage::init() 2022-12-15 15:37:21 +08:00
Martin Vychodil
00f721f746 Merge branch 'refactor/nvs_allocatable_objects' into 'master'
refactor(nvs): custom allocator for all objects allocated in NVS

Closes IDF-6308

See merge request espressif/esp-idf!21239
2022-12-14 17:35:13 +08:00
Jakob Hasse
91f04aa877 refactor(nvs): custom allocator for all objects allocated in NVS 2022-12-05 18:59:33 +01:00
Jakob Hasse
ec986651db bugfix(nvs_flash): fixed wrong error check after open_nvs_handle
Closes https://github.com/espressif/esp-idf/issues/10240
2022-12-01 18:05:56 +01:00
radek.tandler
ca7f073e7b nvs_flash/host_test: migrated to the CMake build system and nvs flash Linux implementation
Host tests of nvs_flash eligible to run in Linux implementation of nvs flash were migrated. Remaining test cases
were left in original folder. Migrated test cases use CMake instead of make.
2022-11-16 14:15:23 +01:00
Martin Vychodil
c9c7573f71 Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:54:45 +01:00
Jakob Hasse
674fa9377f refactor(nvs): using define for namespace len instead of magic number
Closes https://github.com/espressif/esp-idf/issues/9671
2022-10-21 18:12:24 +02:00
Martin Vychodil
4799cc1439 Merge branch 'feature/nvs_partition_parse_tool' into 'master'
tools: NVS partition parser

Closes IDF-4049

See merge request espressif/esp-idf!18107
2022-09-21 22:16:13 +08:00
Mo Fei Fei
ec680a2a82 Docs: Add CN translation for nvs_partition_parser/README.rst 2022-09-20 14:02:23 +00:00
Matus Fabo
1c6edff560 add: data classes for parsing NVS binary data
add: functions to print formatted NVS data
add: color support via ANSI escape sequences
add: documentation
2022-09-20 14:02:23 +00:00
Ivan Grokhotkov
c392c06216
cmake: remove -D prefix from COMPILE_DEFINITIONS property
Unlike COMPILE_OPTIONS, COMPILE_DEFINITIONS CMake property assumes
values without the -D prefix, such as NAME or NAME=VAL.
Previously, IDF build system was passing COMPILE_DEFINITIONS build
property to CMake COMPILE_OPTIONS property, so -D prefix was not
a problem.
Now that COMPILE_DEFINITIONS CMake property is used, -D prefix has
to be removed.

(Note that this doesn't affect 'target_compile_definitions' function,
which strips -D prefix before adding the definition to the property.)
2022-09-20 11:08:02 +02:00
Jakob Hasse
1ab3e64cee doc (nvs): added note about maximum possible namespaces 2022-08-24 15:42:27 +02:00
Jakob Hasse
d6f3666875 Merge branch 'bugfix/nvs_flash_linux_target_cleanups' into 'master'
nvs_flash: cleanups related to linux target

See merge request espressif/esp-idf!19570
2022-08-19 21:07:48 +08:00
Ivan Grokhotkov
c6e9a0c350
esp_common: make esp_err_to_name and ESP_ERROR_CHECK usable on Linux 2022-08-18 18:16:45 +02:00
Ivan Grokhotkov
4e0fa26e64
nvs_flash: link the host test against libbsd when building on Linux
...and clean up the linking rule
2022-08-17 12:20:37 +02:00