以下配置在STM32F103上经实验可用,BOOT0悬空即可。
source [find interface/cmsis-dap.cfg]
set WORKAREASIZE 0x8000
transport select "swd"
set CHIPNAME STM32F103RCTx
set BOARDNAME genericBoard
# 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 8000
# Reset configuration
# 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 0
# set CORE_RESET 0
# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333
# BCTM CPU variables
source [find target/stm32f1x.cfg]
将上述内容保存为自己的.cfg文件。
在Run->Run Configurations,调试器设置为ST-LINK(OpenOCD),下图中选择自定义的.cfg文件: