From 4cad7dde60a334115369642befe4364368fabbc8 Mon Sep 17 00:00:00 2001 From: 1okko <15377594951@189.cn> Date: Wed, 21 Oct 2026 21:14:41 +0800 Subject: [PATCH] hardware: release STM BOOT0 after entering DFU --- openpilot/common/hardware/comma/hardware.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openpilot/common/hardware/comma/hardware.py b/openpilot/common/hardware/comma/hardware.py index a0ec71b6a..d4cb43241 100644 --- a/openpilot/common/hardware/comma/hardware.py +++ b/openpilot/common/hardware/comma/hardware.py @@ -415,9 +415,11 @@ class HardwareComma(HardwareBase): gpio_set(GPIO.STM_BOOT0, True) time.sleep(0.2) gpio_set(GPIO.STM_RST_N, False) + # BOOT0 is latched on the reset edge. Drop it after releasing reset so the + # SPI ROM bootloader responds; leaving it high breaks DFU enumeration. + time.sleep(0.1) + gpio_set(GPIO.STM_BOOT0, False) time.sleep(1) - # Keep BOOT0 high while the SPI ROM bootloader session runs; the custom - # SPI panda needs it held (matches the manual flash scripts). def booted(self): # this normally boots within 8s, but on rare occasions takes 30+s