stm32: Default to --connect-under-reset if flashing via deploy-stlink.

(Can be overridden by setting STFLASH variable.)

Generalises the change from 6b13e6c498 to all
stm32 boards. As we're resetting the target to flash it anyway, it
shouldn't hurt to put the target into reset before trying to connect.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton 2025-12-18 14:59:36 +11:00 committed by Angus Gratton
parent be15be3ab5
commit af76da96a3
4 changed files with 2 additions and 4 deletions

View File

@ -72,7 +72,7 @@ PYDFU ?= $(TOP)/tools/pydfu.py
DFU_UTIL ?= dfu-util
BOOTLOADER_DFU_USB_VID ?= 0x0483
BOOTLOADER_DFU_USB_PID ?= 0xDF11
STFLASH ?= st-flash
STFLASH ?= st-flash --connect-under-reset
OPENOCD ?= openocd
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg

View File

@ -26,5 +26,4 @@ MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
# Flash tool configuration
STFLASH = st-flash --connect-under-reset
OPENOCD_CONFIG = boards/openocd_stm32h7_dual_bank.cfg

View File

@ -26,5 +26,4 @@ MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
# Flash tool configuration
STFLASH = st-flash --connect-under-reset
OPENOCD_CONFIG = boards/openocd_stm32h7_dual_bank.cfg

View File

@ -54,7 +54,7 @@ DFU=$(TOP)/tools/dfu.py
PYDFU ?= $(TOP)/tools/pydfu.py
BOOTLOADER_DFU_USB_VID ?= 0x0483
BOOTLOADER_DFU_USB_PID ?= 0xDF11
STFLASH ?= st-flash
STFLASH ?= st-flash --connect-under-reset
OPENOCD ?= openocd
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg