STM32CubeIDE使用DAP调试器时用到的.cfg配置文件

Posted by 橙叶 on Sat, Aug 13, 2022

以下配置在STM32F103上经实验可用,BOOT0悬空即可。

 1source [find interface/cmsis-dap.cfg]
 2
 3set WORKAREASIZE 0x8000
 4
 5transport select "swd"
 6
 7set CHIPNAME STM32F103RCTx
 8set BOARDNAME genericBoard
 9
10# Enable debug when in low power modes
11set ENABLE_LOW_POWER 1
12
13# Stop Watchdog counters when halt
14set STOP_WATCHDOG 1
15
16# STlink Debug clock frequency
17set CLOCK_FREQ 8000
18
19# Reset configuration
20# use hardware reset, connect under reset
21# connect_assert_srst needed if low power mode application running (WFI...)
22#  reset_config srst_only srst_nogate connect_assert_srst
23# set CONNECT_UNDER_RESET 0
24# set CORE_RESET 0
25
26# ACCESS PORT NUMBER
27set AP_NUM 0
28# GDB PORT
29set GDB_PORT 3333
30
31# BCTM CPU variables
32
33source [find target/stm32f1x.cfg]

将上述内容保存为自己的.cfg文件。

在Run->Run Configurations,调试器设置为ST-LINK(OpenOCD),下图中选择自定义的.cfg文件: file



comments powered by Disqus