Skip to content

Commit af76da9

Browse files
committed
stm32: Default to --connect-under-reset if flashing via deploy-stlink.
(Can be overridden by setting STFLASH variable.) Generalises the change from 6b13e6c 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>
1 parent be15be3 commit af76da9

4 files changed

Lines changed: 2 additions & 4 deletions

File tree

ports/stm32/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ PYDFU ?= $(TOP)/tools/pydfu.py
7272
DFU_UTIL ?= dfu-util
7373
BOOTLOADER_DFU_USB_VID ?= 0x0483
7474
BOOTLOADER_DFU_USB_PID ?= 0xDF11
75-
STFLASH ?= st-flash
75+
STFLASH ?= st-flash --connect-under-reset
7676
OPENOCD ?= openocd
7777
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
7878

ports/stm32/boards/NUCLEO_H723ZG/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2626
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
2727

2828
# Flash tool configuration
29-
STFLASH = st-flash --connect-under-reset
3029
OPENOCD_CONFIG = boards/openocd_stm32h7_dual_bank.cfg

ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2626
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
2727

2828
# Flash tool configuration
29-
STFLASH = st-flash --connect-under-reset
3029
OPENOCD_CONFIG = boards/openocd_stm32h7_dual_bank.cfg

ports/stm32/mboot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DFU=$(TOP)/tools/dfu.py
5454
PYDFU ?= $(TOP)/tools/pydfu.py
5555
BOOTLOADER_DFU_USB_VID ?= 0x0483
5656
BOOTLOADER_DFU_USB_PID ?= 0xDF11
57-
STFLASH ?= st-flash
57+
STFLASH ?= st-flash --connect-under-reset
5858
OPENOCD ?= openocd
5959
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
6060

0 commit comments

Comments
 (0)