Commit Graph

308 Commits

Author SHA1 Message Date
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
Ivan Grokhotkov
7a1e19edf1
nvs_flash: replace strncpy + manual null termination with strlcpy
Since libbsd is now a build dependency on Linux, strncpy can be
replaced with the safer and less verbose strlcpy.
2022-08-17 12:20:36 +02:00
Ivan Grokhotkov
bee241b0e2
nvs_flash: remove leftover ESP_ERROR_CHECKS
Similar to the asserts, these are replaced by error checks.
2022-08-17 12:20:36 +02:00
Ivan Grokhotkov
02661081be
nvs_flash: make nvs_flash_init usable for Linux target
Since the partition API is now supported for Linux target builds,
this function can now be used.
2022-08-17 12:20:36 +02:00
Ivan Grokhotkov
bfb6f31872
nvs_flash: remove unnecessary check that the data pointer is in DROM
spi_flash driver knows how to write data from cache (DROM or PSRAM)
into flash, so the extra check in nvs_flash is unnecessary.
Besides, the hardcoded address limit (0x3ff00000) is wrong for some
of the newer chips.
2022-08-17 12:20:36 +02:00
Ivan Grokhotkov
08e41973f0
nvs_flash: update intrusive_list for compatibility with C++17
std::iterator is deprecated since C++17, the code produces a warning
when compiled with clang and libc++.
2022-08-17 12:20:36 +02:00
simon.chupin
35dda59209 tools: remove the dependency on the future package 2022-08-09 16:46:58 +02:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
Shubham Kulkarni
3689035b7c tests: Fix CI build failures 2022-08-03 05:18:37 +00:00
Angus Gratton
bb141956df nvs_partition_gen: Allow up to 4000 byte strings with NVS V2
As documented, the limit for NVS format v2 is 4000 bytes for a string.
2022-07-22 15:43:19 +10:00
intern
4866e91398 docs: update nvs encryption cn trans 2022-07-18 14:40:56 +08:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Djordje Nedic
0331d0aa63 tools: Introduce support for blank lines in config and value files for mfg utility
Some users have requested this feature.

In order to avoid complete refactoring or introducing more code complexity, a design choice to create temporary files without blank lines is made.

Additionally, an extension check is added and there are multiple smaller code style and structure improvements.

Closes https://github.com/espressif/esp-idf/issues/8421
2022-07-08 13:22:35 +00:00
Cao Sen Miao
a690a87829 spi_flash: Remove legacy spi_flash drivers 2022-07-01 11:01:34 +08:00