From f5475db6e11657975aef12a1315927525fb6d169 Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Mon, 24 Aug 2020 15:26:49 +0800 Subject: [PATCH] example/flash_encryption: Fix partition table and sdkconfig.defaults When the flash encryption is enabled then we do not need to change the partition table. The partition_example.csv should not have fixed offsets for partitions because we want to move the whole table. The fixed offsets in the table were cleared. --- examples/security/flash_encryption/README.md | 4 +--- examples/security/flash_encryption/partitions_example.csv | 6 +++--- examples/security/flash_encryption/sdkconfig.defaults | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/security/flash_encryption/README.md b/examples/security/flash_encryption/README.md index 41a02ba677..96b82c49ba 100644 --- a/examples/security/flash_encryption/README.md +++ b/examples/security/flash_encryption/README.md @@ -19,9 +19,7 @@ idf.py menuconfig * Enable the flash encryption mode (Development or Release) under Security Features. Default usage mode is Development (recommended during test and development phase). -* Ensure Bootloader log verbosity is Info under Bootloader config. - -* Select Single factory app, no OTA under Partition Table options. Change the partition table offset to 0x9000 from 0x8000 since after enabling flash encryption the size of bootloader is increased. +Note: After enabling flash encryption, the bootloader size increases, which means that the offset of the partition table must be changed to 0x9000 from 0x8000 to prevent the bootloader from overlapping with the partition table. In this example, the default offset of the partition table is 0x9000. ### Build and Flash diff --git a/examples/security/flash_encryption/partitions_example.csv b/examples/security/flash_encryption/partitions_example.csv index a7df975994..d352ff92aa 100644 --- a/examples/security/flash_encryption/partitions_example.csv +++ b/examples/security/flash_encryption/partitions_example.csv @@ -1,5 +1,5 @@ # Name, Type, SubType, Offset, Size, Flags -nvs, data, nvs, 0x9000, 0x6000, +nvs, data, nvs, , 0x6000, # Extra partition to demonstrate reading/writing of encrypted flash -storage, data, 0xff, 0xf000, 0x1000, encrypted -factory, app, factory, 0x10000, 1M, +storage, data, 0xff, , 0x1000, encrypted +factory, app, factory, , 1M, diff --git a/examples/security/flash_encryption/sdkconfig.defaults b/examples/security/flash_encryption/sdkconfig.defaults index 6a8feba65b..3300ebfb1a 100644 --- a/examples/security/flash_encryption/sdkconfig.defaults +++ b/examples/security/flash_encryption/sdkconfig.defaults @@ -2,3 +2,4 @@ CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x9000