OpenOCD
Open On-Chip Debugger (OpenOCD) 旨在为嵌入式目标设备提供调试、系统内编程和边界扫描测试。它是在调试适配器的帮助下实现的,调试适配器是一个小型硬件模块,可以帮助为被调试的目标提供正确的电信号。这些都是必需的,因为调试主机(在OpenOCD上运行)通常不支持这样的信号,或连接到目标所需的连接器。
GDB and OpenOCD
Connecting to GDB
-
A socket (TCP/IP) connection is typically started as follows:
target extended-remote localhost:3333
or
target remote localhost:3333
-
A pipe connection is typically started as follows:
target extended-remote | openocd -c "gdb_port pipe; log_output openocd.log"
常见问题
1. 由于仿真环境运行频率较低,导致 Jtag Server 运行频率过低,从而导致 GDB 连接过程中出现 “timeout” in “qSupported” 错误。
解决方法:
-
尝试提高Jtag server 端频率,到 20Khz。
-
修改 GDB 连接超时时间,GDB cmd下执行如下命令:
show remotetimeout
set remotetimeout 60
target remote localhost:3333