feedforward 发表于 2021-12-26 23:27:55

Code::Blocks下通过OpenOCD调试STM32

废话不多,直接上干货!
第一步:在Seting->Debugger中Create Config一个Debugger,命名为OpenOCD,并选择gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gdb的路径:


第二步:在Seting->Compilers Settings->ToolChain executables中选择GNU GCC Compiler for ARM设置编译器路径,并在Debugger中选择刚刚新建的OpenOCD:


第三步:在Project->Properties..->Debugger->all->Remote connection中设置连接类型为TCP,IP地址为127.0.0.1,端口为3333,选中extended-remote:


第四步:在Additional GDB command中设置连接前命令为
cd NuttX
cd nuttx
file nuttx
set remotetimeout 10
连接后命令为:
lo
b __start
monitor halt


第五步:启动OpenOCD,命令为sudo openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c "reset halt"


第六步:在Code::Blocks中编译并调试NuttX




页: [1]
查看完整版本: Code::Blocks下通过OpenOCD调试STM32