xqe2011的赛博大房子

  • 首页
  • 编程分享
  • 资源分享
  • 大杂烩
  1. 首页
  2. 编程分享
  3. 正文

在STM32CubeIDE中使用CMSIS-DAP调试器

2020年10月29日 3060点热度 6人点赞 0条评论

2020年了,STM32CubeIDE还不支持CMSIS-DAP.由于正点原子的远程调试器时基于CMSIS-DAP的,这也就意味着不能远程调试,于是我想能不能修改配置让他支持呢?从理论上来说,STM32CubeIDE用的GDB调试,只要想办法用个GDB服务器连接CMSIS-DAP,STM32CubeIDE再连接GDB服务器就行了.于是我找到了以下方案.

首先,打开“Run->Debug Configurations”,然后按照下图配置.

接着在项目跟目录下建立一个“debug.cfg”,根据实际情况修改下面代码中的“CHIPNAME”和“stm32f4x.cfg”

source [find interface/cmsis-dap.cfg]


set WORKAREASIZE 0x8000

transport select "swd"

set CHIPNAME STM32F427IIHx
set BOARDNAME genericBoard

# Enable debug when in low power modes
set ENABLE_LOW_POWER 1

# Stop Watchdog counters when halt
set STOP_WATCHDOG 1

# DAPLink 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...)
# we use swd mode, so we needn't srst.
#reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
set CORE_RESET 0

# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333



# BCTM CPU variables

source [find target/stm32f4x.cfg]

然后开终端,进入项目根目录,运行“openocd -f debug.cfg”,接着启动STM32CubeIDE的调试功能,保持终端开启即可开始调试.

已知问题

  1. 不可启用Live expression功能
  2. 每次开始调试时需要等一会

标签: CMSIS-DAP STM32 STM32CubeIDE
最后更新:2021年9月23日

xqe2011

愿今后的人生,永远都有幸福的"魔法"相伴

点赞
< 上一篇
下一篇 >

xqe2011

愿今后的人生,永远都有幸福的"魔法"相伴

标签聚合
英伟达 Nvidia VLAN Linux 家庭网络 全志 WebRTC 网络

COPYRIGHT © 2021 xqe2011.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备2020083101号