diff --git a/boards/common/stm32f103c8/Makefile.include b/boards/common/stm32f103c8/Makefile.include index 9cac24d4117d27809fabb554aeecd7ab11dffc33..9efce97dc90de65315d2b39dc472a631c57fd5ac 100644 --- a/boards/common/stm32f103c8/Makefile.include +++ b/boards/common/stm32f103c8/Makefile.include @@ -32,5 +32,9 @@ else export DEBUG_ADAPTER ?= stlink export STLINK_VERSION ?= 2 + # call a 'reset halt' command before starting the debugger + # it is required as `connect_assert_srst` is set + export OPENOCD_DBG_START_CMD = -c 'reset halt' + include $(RIOTMAKE)/tools/openocd.inc.mk endif diff --git a/boards/common/stm32f103c8/dist/openocd.cfg b/boards/common/stm32f103c8/dist/openocd.cfg index ad3f024bf13123c259011ad6cd3e36cd517bed2b..d2e436f461516826da463984bfa56b55e2aa5060 100644 --- a/boards/common/stm32f103c8/dist/openocd.cfg +++ b/boards/common/stm32f103c8/dist/openocd.cfg @@ -1,4 +1,21 @@ +set WORKAREASIZE 0x5000 + +set CHIPNAME STM32F103C8Tx + +# Enable debug when in low power modes +set ENABLE_LOW_POWER 1 + +# Stop Watchdog counters when halt +set STOP_WATCHDOG 1 + +# STlink Debug clock frequency +set CLOCK_FREQ 4000 + +# use hardware reset, connect under reset +# connect_assert_srst needed if low power mode application running (WFI...) +reset_config srst_only srst_nogate connect_assert_srst +set CONNECT_UNDER_RESET 1 + source [find target/stm32f1x.cfg] -reset_config none separate $_TARGETNAME configure -rtos auto