nvs_flash: Modify the default NVS initialization API with internal nvs encryption

handling (only when nvs encryption is enabled)
    * NVS Encryption will now be turned on by default with flash encryption
    * Updated the flash encryption example to shocase NVS encryption
    along with information on how to configure and use NVS encryption
    * Updated respective test case
    * Added two partition tables for NVS encryption
     i) Table 1- Single factory app, no OTA, encrypted NVS
     ii) Table 2- Factory app, Two OTA, encrypted NVS
This commit is contained in:
Aditya Patwardhan
2020-12-15 08:31:39 +05:30
committed by bot
parent b77c85c1e1
commit a02be97fda
14 changed files with 164 additions and 9 deletions

View File

@@ -18,6 +18,12 @@ menu "Partition Table"
bool "Factory app, two OTA definitions"
config PARTITION_TABLE_CUSTOM
bool "Custom partition table CSV"
config PARTITION_TABLE_SINGLE_APP_ENCRYPTED_NVS
bool "Single factory app, no OTA, encrypted NVS"
depends on !ESP32_COREDUMP_ENABLE_TO_FLASH && NVS_ENCRYPTION
config PARTITION_TABLE_TWO_OTA_ENCRYPTED_NVS
bool "Factory app, two OTA definitions, encrypted NVS"
depends on !ESP_COREDUMP_ENABLE_TO_FLASH && NVS_ENCRYPTION
endchoice
config PARTITION_TABLE_CUSTOM_FILENAME
@@ -31,8 +37,10 @@ menu "Partition Table"
string
default "partitions_singleapp.csv" if PARTITION_TABLE_SINGLE_APP && !ESP_COREDUMP_ENABLE_TO_FLASH
default "partitions_singleapp_coredump.csv" if PARTITION_TABLE_SINGLE_APP && ESP_COREDUMP_ENABLE_TO_FLASH
default "partitions_singleapp_encr_nvs.csv" if PARTITION_TABLE_SINGLE_APP_ENCRYPTED_NVS
default "partitions_two_ota.csv" if PARTITION_TABLE_TWO_OTA && !ESP_COREDUMP_ENABLE_TO_FLASH
default "partitions_two_ota_coredump.csv" if PARTITION_TABLE_TWO_OTA && ESP_COREDUMP_ENABLE_TO_FLASH
default "partitions_two_ota_encr_nvs.csv" if PARTITION_TABLE_TWO_OTA_ENCRYPTED_NVS
default PARTITION_TABLE_CUSTOM_FILENAME if PARTITION_TABLE_CUSTOM
config PARTITION_TABLE_OFFSET

View File

@@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, , 0x6000,
phy_init, data, phy, , 0x1000,
factory, app, factory, , 1M,
nvs_key, data, nvs_keys,, 0x1000, encrypted
1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
3 nvs, data, nvs, , 0x6000,
4 phy_init, data, phy, , 0x1000,
5 factory, app, factory, , 1M,
6 nvs_key, data, nvs_keys,, 0x1000, encrypted

View File

@@ -0,0 +1,9 @@
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, , 0x4000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
factory, app, factory, , 1M,
ota_0, app, ota_0, , 1M,
ota_1, app, ota_1, , 1M,
nvs_key, data, nvs_keys,, 0x1000, encrypted
1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
3 nvs, data, nvs, , 0x4000,
4 otadata, data, ota, , 0x2000,
5 phy_init, data, phy, , 0x1000,
6 factory, app, factory, , 1M,
7 ota_0, app, ota_0, , 1M,
8 ota_1, app, ota_1, , 1M,
9 nvs_key, data, nvs_keys,, 0x1000, encrypted