Skip to content

Latest commit

 

History

History
 
 

jlink

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

#Raspi3 Raspi4 jtag debug

  1. Connect the JTAG to RPI

40-pin gpio connect

gpio22-27 Alternative Function Assignments all are ALT4.

connect following gpio pin to jlink pin.

管脚名字 gpio功能ALT4
GPIO22 ARM_TRST
GPIO23 ARM_RTCK
GPIO24 ARM_TDO
GPIO25 ARM_TCK
GPIO26 ARM_TDI
GPIO27 ARM_TMS
3.3v Vref
GPIO09 GND
  1. copy some files into SD card
  • Copy the config.txt and loop.bin into SD boot partition.
  • Insert the SD card to PI.
  • Power on the PI.

Connect the JLINK to PC.

  1. Download the openocd. https://github.com/xpack-dev-tools/openocd-xpack/releases you can download the pre-build or download the source code build by youself.

注意:使用我们提供的Vmware image,内置了openocd,不需要额外下载。

  1. run the openocd to connect the JLINK $ sudo openocd -f jlink.cfg -f raspi4.cfg or $ sudo ./openocd/0.10.0-13/bin/openocd -f jlink.cfg -f raspi4.cfg

  2. Open another terminal. $ telnet localhost 4444

halt load_image /home/rlk/xxx/BenOS/arch/arm64/boot/benos.bin 0x80000 step 0x80000

  1. Open another terminal. $ gdb-multiarch --tui benos (gdb) target remote localhost:3333 (gdb) b print_el #set break point (gdb) s # step to debug