mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
refactor(examples/storage): move all the nvs examples to 'examples/storeage/nvs' directory
This commit is contained in:
@ -16,44 +16,6 @@ examples/storage/emmc:
|
||||
- if: IDF_TARGET == "esp32s3"
|
||||
reason: only support on esp32s3
|
||||
|
||||
examples/storage/nvs_bootloader:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
- nvs_sec_provider
|
||||
disable:
|
||||
- if: CONFIG_NAME == "nvs_enc_flash_enc" and (SOC_AES_SUPPORTED != 1 and ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB != 1)
|
||||
- if: CONFIG_NAME == "nvs_enc_hmac" and (SOC_HMAC_SUPPORTED != 1 or (SOC_HMAC_SUPPORTED == 1 and (SOC_AES_SUPPORTED != 1 and ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB != 1)))
|
||||
reason: As of now in such cases, we do not have any way to perform AES operations in the bootloader build
|
||||
|
||||
examples/storage/nvs_rw_blob:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
- driver
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvs_rw_value:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvs_rw_value_cxx:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvsgen:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET != "esp32"
|
||||
reason: only one target needed
|
||||
|
||||
examples/storage/partition_api/partition_find:
|
||||
depends_components:
|
||||
- esp_partition
|
||||
|
39
examples/storage/nvs/.build-test-rules.yml
Normal file
39
examples/storage/nvs/.build-test-rules.yml
Normal file
@ -0,0 +1,39 @@
|
||||
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
|
||||
|
||||
examples/storage/nvs/nvs_bootloader:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
- nvs_sec_provider
|
||||
disable:
|
||||
- if: CONFIG_NAME == "nvs_enc_flash_enc" and (SOC_AES_SUPPORTED != 1 and ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB != 1)
|
||||
- if: CONFIG_NAME == "nvs_enc_hmac" and (SOC_HMAC_SUPPORTED != 1 or (SOC_HMAC_SUPPORTED == 1 and (SOC_AES_SUPPORTED != 1 and ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB != 1)))
|
||||
reason: As of now in such cases, we do not have any way to perform AES operations in the bootloader build
|
||||
|
||||
examples/storage/nvs/nvs_rw_blob:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
- driver
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvs/nvs_rw_value:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvs/nvs_rw_value_cxx:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET not in ["esp32", "esp32c3"]
|
||||
reason: only one target per arch needed
|
||||
|
||||
examples/storage/nvs/nvsgen:
|
||||
depends_components:
|
||||
- nvs_flash
|
||||
disable_test:
|
||||
- if: IDF_TARGET != "esp32"
|
||||
reason: only one target needed
|
@ -137,7 +137,7 @@ Enable NVS encryption using your preferred scheme. Please find more details rega
|
||||
(Note: In case you select the `HMAC based NVS encryption scheme`, make sure that you burn the below mentioned [HMAC key](./main/nvs_enc_hmac_key.bin) in the efuses.)
|
||||
|
||||
For generating the encrypted NVS partitions, we shall use [NVS partition generator](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/storage/nvs_partition_gen.html#nvs-partition-generator-utility).
|
||||
We shall use the [nvs_partition_gen.py](../../../components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py) script for the operations.
|
||||
We shall use the [nvs_partition_gen.py](../../../../components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py) script for the operations.
|
||||
|
||||
Along with the above mentioned file structure, the project folder also contains pre-generated encrypted partitions and the partition corresponding to the selected NVS encryption scheme is flashed along with the build artefacts using the `main/CMakeLists.txt`.
|
||||
|
||||
@ -146,13 +146,13 @@ In case the data in `nvs_data.csv` is modified, these encrypted NVS partitions c
|
||||
1. NVS Encryption using the flash encryption scheme
|
||||
|
||||
```
|
||||
python nvs_partition_gen.py encrypt $IDF_PATH/examples/storage/nvs_bootloader/nvs_data.csv $IDF_PATH/examples/storage/nvs_bootloader/main/nvs_encrypted.bin 0x6000 --inputkey $IDF_PATH/examples/storage/nvs_bootloader/main/encryption_keys.bin
|
||||
python nvs_partition_gen.py encrypt $IDF_PATH/examples/storage/nvs/nvs_bootloader/nvs_data.csv $IDF_PATH/examples/storage/nvs/nvs_bootloader/main/nvs_encrypted.bin 0x6000 --inputkey $IDF_PATH/examples/storage/nvs/nvs_bootloader/main/encryption_keys.bin
|
||||
```
|
||||
|
||||
2. NVS Encryption using the HMAC scheme
|
||||
|
||||
```
|
||||
python nvs_partition_gen.py encrypt $IDF_PATH/examples/storage/nvs_bootloader/nvs_data.csv $IDF_PATH/examples/storage/nvs_bootloader/main/nvs_encrypted_hmac.bin 0x6000 --keygen --key_protect_hmac --kp_hmac_inputkey $IDF_PATH/examples/storage/nvs_bootloader/main/nvs_enc_hmac_key.bin
|
||||
python nvs_partition_gen.py encrypt $IDF_PATH/examples/storage/nvs/nvs_bootloader/nvs_data.csv $IDF_PATH/examples/storage/nvs/nvs_bootloader/main/nvs_encrypted_hmac.bin 0x6000 --keygen --key_protect_hmac --kp_hmac_inputkey $IDF_PATH/examples/storage/nvs/nvs_bootloader/main/nvs_enc_hmac_key.bin
|
||||
```
|
||||
|
||||
Build the application using configurations corresponding to the NVS encryption scheme that you have selected:
|
Can't render this file because it has a wrong number of fields in line 4.
|
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
/* Non-Volatile Storage (NVS) Read and Write a Blob - Example
|
||||
|
||||
For other examples please check:
|
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
/* Non-Volatile Storage (NVS) Read and Write a Value - Example
|
||||
|
||||
For other examples please check:
|
@ -1,3 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
/* Non-Volatile Storage (NVS) Read and Write a Value - Example
|
||||
|
||||
For other examples please check:
|
@ -5,7 +5,7 @@
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
This example demonstrates how to use the NVS image generation tool [nvs_partition_gen.py](../../../components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py) to automatically create a NVS partition image from the contents of a CSV file during build, with an option of automatically flashing the created image on invocation of `idf.py -p PORT flash`. For more information, see description of `nvs_partition_gen.py` on the ESP-IDF Programming Guide under API Reference > Storage API > NVS Partition Generator Utility.
|
||||
This example demonstrates how to use the NVS image generation tool [nvs_partition_gen.py](../../../../components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py) to automatically create a NVS partition image from the contents of a CSV file during build, with an option of automatically flashing the created image on invocation of `idf.py -p PORT flash`. For more information, see description of `nvs_partition_gen.py` on the ESP-IDF Programming Guide under API Reference > Storage API > NVS Partition Generator Utility.
|
||||
|
||||
The following gives an overview of the example:
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -908,9 +908,6 @@ examples/protocols/static_ip/main/static_ip_example_main.c
|
||||
examples/provisioning/wifi_prov_mgr/main/app_main.c
|
||||
examples/security/flash_encryption/main/flash_encrypt_main.c
|
||||
examples/storage/custom_flash_driver/main/main.c
|
||||
examples/storage/nvs_rw_blob/main/nvs_blob_example_main.c
|
||||
examples/storage/nvs_rw_value/main/nvs_value_example_main.c
|
||||
examples/storage/nvs_rw_value_cxx/main/nvs_value_example_main.cpp
|
||||
examples/storage/partition_api/partition_find/main/main.c
|
||||
examples/storage/partition_api/partition_mmap/main/main.c
|
||||
examples/storage/partition_api/partition_ops/main/main.c
|
||||
|
Reference in New Issue
Block a user