STM32CubeIDE 使用 dap 通过 openocd 调试

需求 最近使用 stm32u575 芯片的时候,调试时发现很尴尬的问题, jlink 必须安装高版本,然后盗版的就不能用了。MDK 可以直接使用 DAPLink,但是 stm32cubeide 不能直接支持。所以需要想办法解决这个问题。 解决 参考了网上的资料,st 自带的 openocd 不能用,端口不对。 openocd 需要下载官方的 openocd,不要使用 stm32cubeide 自带的。下载地址: https://gnutoolchains.com/arm-eabi/openocd/ 。下载后自行安装。 配置 openocd stm32cubeide 菜单栏 -> Run -> External Tools -> External Tools Configrations -> Program 右键 -> New Configration. Name 自己输入。 Location: 选择刚才下载的 openocd 中的 openocd.exe 所在路径。 Arguments: -f interface\cmsis-dap.cfg -f target\stm32u5x.cfg apply 然后 Run. 配置 debug Run -> Debug Configurations -> GDB Hardware Debugging 右键 -> New Configuratin....

2023-10-10 · 1 min · 168 words · RamLife