文章目录
- OpenOCD arp_examine 使用
OpenOCD arp_examine 使用
因为我们很多时候运行 Openocd 的时候有些 core 还没有启动, 所以最好在配置脚本中添加 -defer-examine
这个参数, 如下:
#cortex-m33
target create ${_CHIPNAME}.m33 cortex_m -dap ${_CHIPNAME}.dap -ap-num 0x6B240000 -dbgbase 0xE000E000 -defer-examine
添加完之后,在启动Openocd之后:
> Connection closed by foreign host.
zhugong@:~/workbase/openocd/$ telnet 127.0.0.1 8888
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> targets
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0 debug.a53.0 aarch64 little debug.cpu examine deferred
1 debug.a53.1 aarch64 little debug.cpu examine deferred
2 debug.a53.2 aarch64 little debug.cpu examine deferred
3 debug.a53.3 aarch64 little debug.cpu examine deferred
4 debug.a78.0 aarch64 little debug.cpu examine deferred
5 debug.a78.1 aarch64 little debug.cpu examine deferred
6 debug.a78.2 aarch64 little debug.cpu examine deferred
7 debug.a78.3 aarch64 little debug.cpu examine deferred
8 debug.m33 cortex_m little debug.cpu examine deferred
9 debug.m33_ahb mem_ap little debug.cpu running
在使用某个AP的时候需要先手动做arp_examine
,否则会报错Target not examined yet
,如下图所示:
> targets debug.axi
> mdw 0x88000000 4
Target not examined yet
添加过 -defer-examine
参数之后可以使用下面类似的命令 enable 这个AP:
> debug.axi arp_examine
> debug.axi mdw 0x80000000 4
0x80000000: 00000000 00000000 00000000 00000000