OpenOCD- Jlink&IAR via GDB Server

本文介绍了如何在Windows环境下利用OpenOCD与GDB Server进行STM32微控制器的远程调试,包括设置OpenOCD GDB服务器、配置IAR调试环境、以及通过本地主机地址连接进行调试的全过程。此教程适用于STM32开发人员,旨在提高开发效率并优化调试体验。

After installation of OpenOCD

http://blog.youkuaiyun.com/iamlvshijie/article/details/7423611

we can test GCB Sever before development.

What is GDB Server?

from wikipedia:

gdbserver is a computer program that makes it possible to remotely debug other programs.[1] Running on the same system as the program to be debugged, it allows the GNU Debugger to connect from another system; that is, only the executable to be debugged needs to be resident on the target system, while the source code and a copy of the binary file to be debugged reside on the developer’s local computer. The connection can be either TCP or a serial line.

Step1: Run OpenOCD GDB Server

run your openocd, telling it you jtag interface and target like this, I write a bat  file for windows.

@echo OpenOCD JLink GDBServer
c:
cd cygwin\openocd\tcl
openocd -f interface/jlink.cfg -f target/stm32f1x.cfg
pause

then I check the network connecting:



Step2: IAR Setting

open a IAR Project, then make the projects.

choose project>Options>Debugger

select GDB Server,



then 



type localhost, 3333   //attention, there is a comma before 3333

so why is 3333? we check it out.

openocd use the tcp port 3333.


Step3 Debugging

then start debugging: Project>Download> Debug

check it again:



It proves what is GDB server.

Done. It is a little slower than using jlink directly. 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值