From 98db4d2eb6fa6225dca18015c4c469a3c5428a3f Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Fri, 15 Mar 2019 20:02:16 +0800 Subject: [PATCH 1/2] esp_tool: Exclude elf-sha256 from bootloader Closes: IDFGH-690 --- components/esptool_py/Makefile.projbuild | 2 ++ components/esptool_py/project_include.cmake | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/esptool_py/Makefile.projbuild b/components/esptool_py/Makefile.projbuild index 25f2487ab..092ac0e02 100644 --- a/components/esptool_py/Makefile.projbuild +++ b/components/esptool_py/Makefile.projbuild @@ -39,7 +39,9 @@ endif endif endif +ifndef IS_BOOTLOADER_BUILD ESPTOOL_ELF2IMAGE_OPTIONS += --elf-sha256-offset 0xb0 +endif ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z,-u) $(ESPTOOL_WRITE_FLASH_OPTIONS) diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 2d05f11a7..d03552723 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -52,7 +52,9 @@ if(CONFIG_SECURE_BOOT_ENABLED AND ${ESPTOOLPY_ELF2IMAGE_FLASH_OPTIONS} --secure-pad) endif() -set(ESPTOOLPY_ELF2IMAGE_OPTIONS --elf-sha256-offset 0xb0) +if(NOT BOOTLOADER_BUILD) + set(ESPTOOLPY_ELF2IMAGE_OPTIONS --elf-sha256-offset 0xb0) +endif() if(CONFIG_ESPTOOLPY_FLASHSIZE_DETECT) # Set ESPFLASHSIZE to 'detect' *after* elf2image options are generated, From 0514a65cc9d0b0d9c98a5927a066e7d6581a87fe Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Tue, 19 Mar 2019 13:29:07 +0800 Subject: [PATCH 2/2] esptool: Only insert SHA256 if overwriting zero data --- components/esptool_py/esptool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esptool_py/esptool b/components/esptool_py/esptool index 9ad444a6e..40258ed6d 160000 --- a/components/esptool_py/esptool +++ b/components/esptool_py/esptool @@ -1 +1 @@ -Subproject commit 9ad444a6e06e58833d5e6044c1d5f3eb3dd56023 +Subproject commit 40258ed6de78672ef20862fea24fbdf4a9b38413