gdb + openocd 调试嵌入式软件

1.openocd是硬件层次的调试,gdb是源码层次的调试。


2.在gdb中可以使用monitor发送openocd的命令,例如monitor reset;halt


3.JTAG有4种复位方式:

There are many kinds of reset possible through JTAG, but they may not
all work with a given board and adapter. That’s part of why reset
configuration can be error prone.
System Reset, the SRST hardware signal resets all chips connected to the JTAG adapter, such as processors, power management chips, and I/O controllers. Normally resets triggered with this signal behave exactly like pressing a RESET button.
JTAG TAP Reset, the TRST hardware signal resets just the TAP
controllers con- nected to the JTAG adapter. Such resets should not be
visible to the rest of the system; resetting a device’s TAP controller
just puts that controller into a known state.
Emulation Reset, many devices can be reset through JTAG commands.
These resets are often distinguishable from system resets, either
explicitly (a “reset reason” register says so) or implicitly (not all
parts of the chip get reset).
Other Resets, system-on-chip devices often support several other
types of reset. You may need to arrange that a watchdog timer stops
while debugging, preventing a watchdog reset. There may be individual
module resets.
In the best case, OpenOCD can hold SRST, then reset the TAPs via TRST and send commands through JTAG to halt the CPU at the reset vector before the 1st instruction is executed. Then when it finally releases
the SRST signal, the system is halted under debugger control before
any code has executed. This is the behavior required to support the
reset halt and reset init commands; after reset init a board-specific
script might do things like setting up DRAM. (See [Reset Command],
page 97.)

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值