Hello everyone,
I succeeded to read the CPU registers via JTAG debugger!
So, I would like to share the instruction of JTAG debugging setting and the OpenOCD target configuration file for that.
NOTE: I have checked that I can read CPU registers, but I have not tested anything else.
Preparation:
- Install OpenOCD(git HEAD version)
- Update the Bus Blaster v3 buffer to KT-Link compatible buffer:
- Please refer this document to update Bus Blaster:
- https://github.com/96boards/documentation/blob/master/enterprise/developerbox/installation/board-recovery.md#jtag-recovery
- Don’t forget to remove power supply jumper
- Download target config from this URL:
- Turn on SW2-8 switch(It seems like a debug mode switch)
How to use:
- Launch OpenOCD:
- openocd -f interface/ftdi/dp_busblaster_kt-link.cfg -f sc2a11.cfg
- Launch GDB and connect to gdb server:
- aarch64-linux-gnu-gdb
- (gdb) target remote :3333
Here is the log when reading CPU registers.
> aarch64-linux-gnu-gdb
GNU gdb (GDB) 8.2
…
(gdb) target remote :3333
Remote debugging using :3333
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0xffff00000888b2a0 in ?? ()
(gdb) i r
x0 0x2 2
x1 0xffff80087b9ae318 18446603372654682904
x2 0xffff80087b9ae308 18446603372654682888
x3 0x0 0
x4 0x0 0
x5 0x0 0
x6 0x0 0
x7 0x0 0
x8 0x0 0
x9 0x8 8
x10 0x34d5d91d 886429981
x11 0x800872ccf000 140773774127104
x12 0xffff000009063180 18446462598884241792
x13 0x0 0
x14 0xf97 3991
x15 0x71d 1821
x16 0x0 0
x17 0xcb1c6 831942
x18 0x4100d 266253
x19 0xffff80087b9ae308 18446603372654682888
x20 0xffffffff 4294967295
x21 0x0 0
x22 0x2 2
x23 0xffff800879ed6c00 18446603372626537472
x24 0x1 1
x25 0x85bf61f4c8 574441518280
x26 0xffff000009063180 18446462598884241792
x27 0xf83fd084 4164931716
x28 0x80b90018 2159607832
x29 0xffff000009053d90 18446462598884179344
x30 0xffff000008159a8c 18446462598868474508
...