Merge branch 'bugfix/check_bootloader_size_with_sign_v5.1' into 'release/v5.1'

fix(esptool_py): Check the size of the bootloader + signature block (v5.1)

See merge request espressif/esp-idf!33592
This commit is contained in:
Jiang Jiang Jian 2024-09-21 14:42:48 +08:00
commit 6983207dd1
3 changed files with 17 additions and 8 deletions

View File

@ -60,10 +60,19 @@ consist of two ota app without factory or test partitions.")
endif() # NOT BOOTLOADER_BUILD endif() # NOT BOOTLOADER_BUILD
if(BOOTLOADER_BUILD) if(BOOTLOADER_BUILD)
# Generate bootloader post-build check of the bootloader size against the offset # Generate bootloader post-build check of the bootloader size against the offset
partition_table_add_check_bootloader_size_target(bootloader_check_size partition_table_add_check_bootloader_size_target(bootloader_check_size
DEPENDS gen_project_binary DEPENDS gen_project_binary
BOOTLOADER_BINARY_PATH "${build_dir}/${PROJECT_BIN}" BOOTLOADER_BINARY_PATH "${build_dir}/${PROJECT_BIN}"
RESULT bootloader_check_size_command) RESULT bootloader_check_size_command)
add_dependencies(app bootloader_check_size) # note: in the subproject, so the target is 'app'... add_dependencies(app bootloader_check_size) # note: in the subproject, so the target is 'app'...
if(CONFIG_SECURE_BOOT_V2_ENABLED AND CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)
# Check the size of the bootloader + signature block.
partition_table_add_check_bootloader_size_target(bootloader_check_size_signed
DEPENDS gen_signed_bootloader
BOOTLOADER_BINARY_PATH "${build_dir}/${PROJECT_BIN}"
RESULT bootloader_check_size_signed_command)
add_dependencies(app bootloader_check_size_signed) # note: in the subproject, so the target is 'app'...
endif()
endif() endif()

View File

@ -6,7 +6,7 @@ CONFIG_IDF_TARGET="esp32"
CONFIG_ESP32_REV_MIN_3=y CONFIG_ESP32_REV_MIN_3=y
CONFIG_ESP32_REV_MIN=3 CONFIG_ESP32_REV_MIN=3
CONFIG_PARTITION_TABLE_OFFSET=0xD000 CONFIG_PARTITION_TABLE_OFFSET=0xE000
CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv" CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv"

View File

@ -3,7 +3,7 @@
# #
# If you find yourself needing to edit this in the future, it's a sign the # If you find yourself needing to edit this in the future, it's a sign the
# bootloader is bloating out! # bootloader is bloating out!
CONFIG_PARTITION_TABLE_OFFSET=0xC000 CONFIG_PARTITION_TABLE_OFFSET=0xD000
# Maximize the number of possible build warnings # Maximize the number of possible build warnings
CONFIG_COMPILER_OPTIMIZATION_PERF=y CONFIG_COMPILER_OPTIMIZATION_PERF=y