Browse Source

esptool: Add support for ESP32-S2 Secure Download Mode

* Pass --no-stub from build system if configured to enable ESP32-S2 Secure Download Mode
* Update esptool submodule
Angus Gratton 5 years ago
parent
commit
d45eabe676

+ 5 - 1
components/esptool_py/CMakeLists.txt

@@ -27,7 +27,11 @@ if(NOT BOOTLOADER_BUILD)
     set(ESPTOOLPY_BEFORE "${CONFIG_ESPTOOLPY_BEFORE}")
     set(ESPTOOLPY_AFTER  "${CONFIG_ESPTOOLPY_AFTER}")
     set(ESPTOOLPY_CHIP "${target}")
-    set(ESPTOOLPY_WITH_STUB TRUE)
+    if(CONFIG_ESPTOOLPY_WITH_STUB)
+        set(ESPTOOLPY_WITH_STUB true)
+    else()
+        set(ESPTOOLPY_WITH_STUB false)
+    endif()
 
     if(CONFIG_SECURE_BOOT OR CONFIG_SECURE_FLASH_ENC_ENABLED)
         # If security enabled then override post flash option

+ 6 - 0
components/esptool_py/Kconfig.projbuild

@@ -54,6 +54,12 @@ menu "Serial flasher config"
             decompress it on the fly before flashing it. For most payloads, this should result in a
             speed increase.
 
+    config ESPTOOLPY_WITH_STUB
+        # Only real reason to disable this is when ESP32-S2 Secure Download Mode is set
+        bool
+        default "y"
+        depends on !SECURE_ENABLE_SECURE_ROM_DL_MODE
+
     choice ESPTOOLPY_FLASHMODE
         prompt "Flash SPI mode"
         default ESPTOOLPY_FLASHMODE_DIO

+ 1 - 1
components/esptool_py/esptool

@@ -1 +1 @@
-Subproject commit 988b9a24414bba694ae9994728865148ee95848a
+Subproject commit 5eada56341f3a74c3e09eef3b1266f1072145059

+ 1 - 1
components/esptool_py/flasher_args.json.in

@@ -16,7 +16,7 @@
     "extra_esptool_args" : {
         "after"  : "${ESPTOOLPY_AFTER}",
         "before" : "${ESPTOOLPY_BEFORE}",
-        "stub"   : "${ESPTOOLPY_WITH_STUB}",
+        "stub"   : ${ESPTOOLPY_WITH_STUB},
         "chip"   : "${ESPTOOLPY_CHIP}"
     }
 }

+ 3 - 0
components/esptool_py/project_include.cmake

@@ -153,6 +153,9 @@ else()
     list(APPEND esptool_flash_main_args "--after=${CONFIG_ESPTOOLPY_AFTER}")
 endif()
 
+if(NOT CONFIG_ESPTOOLPY_WITH_STUB)
+    list(APPEND esptool_flash_main_args "--no-stub")
+endif()
 
 idf_component_set_property(esptool_py FLASH_ARGS "${esptool_flash_main_args}")
 idf_component_set_property(esptool_py FLASH_SUB_ARGS "${ESPTOOLPY_FLASH_OPTIONS}")