Merge branch 'feature/esptool_allow_no_stub' into 'master'

Allow esptool's download stub to be disabled by other options and applications

See merge request espressif/esp-idf!10114
This commit is contained in:
Angus Gratton
2020-09-26 01:25:53 +08:00
4 changed files with 11 additions and 9 deletions

View File

@@ -763,6 +763,7 @@ menu "Security features"
config SECURE_ENABLE_SECURE_ROM_DL_MODE config SECURE_ENABLE_SECURE_ROM_DL_MODE
bool "Permanently switch to ROM UART Secure Download mode" bool "Permanently switch to ROM UART Secure Download mode"
depends on SECURE_TARGET_HAS_SECURE_ROM_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE depends on SECURE_TARGET_HAS_SECURE_ROM_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE
select ESPTOOLPY_NO_STUB
help help
If set, during startup the app will burn an eFuse bit to permanently switch the UART ROM If set, during startup the app will burn an eFuse bit to permanently switch the UART ROM
Download Mode into a separate Secure Download mode. This option can only work if Download Mode into a separate Secure Download mode. This option can only work if

View File

@@ -27,10 +27,10 @@ if(NOT BOOTLOADER_BUILD)
set(ESPTOOLPY_BEFORE "${CONFIG_ESPTOOLPY_BEFORE}") set(ESPTOOLPY_BEFORE "${CONFIG_ESPTOOLPY_BEFORE}")
set(ESPTOOLPY_AFTER "${CONFIG_ESPTOOLPY_AFTER}") set(ESPTOOLPY_AFTER "${CONFIG_ESPTOOLPY_AFTER}")
set(ESPTOOLPY_CHIP "${target}") set(ESPTOOLPY_CHIP "${target}")
if(CONFIG_ESPTOOLPY_WITH_STUB) if(CONFIG_ESPTOOLPY_NO_STUB)
set(ESPTOOLPY_WITH_STUB true)
else()
set(ESPTOOLPY_WITH_STUB false) set(ESPTOOLPY_WITH_STUB false)
else()
set(ESPTOOLPY_WITH_STUB true)
endif() endif()
if(CONFIG_SECURE_BOOT OR CONFIG_SECURE_FLASH_ENC_ENABLED) if(CONFIG_SECURE_BOOT OR CONFIG_SECURE_FLASH_ENC_ENABLED)

View File

@@ -54,11 +54,12 @@ menu "Serial flasher config"
decompress it on the fly before flashing it. For most payloads, this should result in a decompress it on the fly before flashing it. For most payloads, this should result in a
speed increase. speed increase.
config ESPTOOLPY_WITH_STUB config ESPTOOLPY_NO_STUB
# Only real reason to disable this is when ESP32-S2 Secure Download Mode is set bool "Disable download stub"
bool default "n"
default "y" help
depends on !SECURE_ENABLE_SECURE_ROM_DL_MODE The flasher tool sends a precompiled download stub first by default. That stub allows things
like compressed downloads and more. Usually you should not need to disable that feature
choice ESPTOOLPY_FLASHMODE choice ESPTOOLPY_FLASHMODE
prompt "Flash SPI mode" prompt "Flash SPI mode"

View File

@@ -160,7 +160,7 @@ else()
list(APPEND esptool_flash_main_args "--after=${CONFIG_ESPTOOLPY_AFTER}") list(APPEND esptool_flash_main_args "--after=${CONFIG_ESPTOOLPY_AFTER}")
endif() endif()
if(NOT CONFIG_ESPTOOLPY_WITH_STUB) if(CONFIG_ESPTOOLPY_NO_STUB)
list(APPEND esptool_flash_main_args "--no-stub") list(APPEND esptool_flash_main_args "--no-stub")
endif() endif()