mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 14:28:54 +08:00
fix: enable auto-detection of ESP32-S2 in secure download mode
This commit is contained in:
@@ -165,11 +165,16 @@ def detect_chip(
|
|||||||
ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR
|
ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR
|
||||||
)
|
)
|
||||||
except UnsupportedCommandError:
|
except UnsupportedCommandError:
|
||||||
raise FatalError(
|
# Only ESP32-S2 does not support chip id detection
|
||||||
"Unsupported Command Error received. "
|
# and supports secure download mode
|
||||||
"Probably this means Secure Download Mode is enabled, "
|
inst = CHIP_DEFS["esp32s2"](
|
||||||
"autodetection will not work. Need to manually specify the chip."
|
detect_port._port, baud, trace_enabled=trace_enabled
|
||||||
)
|
)
|
||||||
|
si = inst.get_security_info()
|
||||||
|
inst.secure_download_mode = si["parsed_flags"]["SECURE_DOWNLOAD_ENABLE"]
|
||||||
|
inst = check_if_stub(inst)
|
||||||
|
inst._post_connect()
|
||||||
|
return inst
|
||||||
except FatalError:
|
except FatalError:
|
||||||
log.print(" Autodetection failed, trying again...")
|
log.print(" Autodetection failed, trying again...")
|
||||||
detect_port.connect(
|
detect_port.connect(
|
||||||
|
Reference in New Issue
Block a user