Starting with JLink debugger or QEMU (ARMv8)
- Debugger: JLink V11
- Target Hardware: raspiberry 4b
- Host: Ubuntu 20.04-amd64
Note, the openocd installed by sudo apt-get install openocd
is not work on ubuntu 20.04. The error prompted Error: invalid command name "dap"
. So you shall compile the openocd by yourself. Please refer to the link https://hackaday.io/page/4991... (Though it is targetting for ubuntu 16.04, the 20.04 still follow these build steps.)
1. JLink Brief
We should use the three command terminals to launch the Jlink debugger. They are openocd/telnet/gbd-multiarch separately.
On the openocd command line, should type the cmd is:
sudo openocd -f jlink.cfg -f raspi4.cfg
On the telnet command line, should type the cmds are:
telnet localhost 4444
> halt
> load_image /home/carlos/work/uncleben/armv8_trainning/lab01/benos.bin 0x80000
> step 0x80000
On the gdb command line, should ytpe the cmds are:
gdb-multiarch --tui benos.elf
> target remote localhost:3333
> b ldr_start
> c
> n
> layout regs
2. QEMU Brief
The QEMU is more simple and more quicker than the JLink debugger env.
On the QEMU side, just type the qemu-system-aarch64 -machine raspi4 -nographic -kernel benos.bin -S -s
to launch the QEMU. For the gdb-multiarch side, gdb-multiarch --tui benos.elf
gdb-multiarch --tui benos.elf, the localhost port is 1234.
gdb-multiarch --tui benos.elf
> target remote localhost:1234
> b ldr_start
> c
> n
> layout regs
For the config files, you can get them by
https://gist.github.com/carlo...
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。