mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 00:50:42 +08:00
2.0 KiB
2.0 KiB
Rpi4
This example is for testing OpenOCD capablility of debugging Linux kernel and kerel module.
Prerequisite
- Hardware debugger: JLink, Olimex, .... any hardware debugger supported by OpenOCD. In this case, Jlink has been used.
- Rasberry Pi 4, micros SD card, micros SD card reader
- OpenOCD installed on your system. You can run
install_openocd.shto automatically install it. - Docker installed on your system. You can run
install_docker.shto automatically install it.
Build Rpi4 image
make build_dockerto build dockermake dockerto enter docker containermake owrtto build owrt image. Final image will be: openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.imgmake yoctoto build yocto image. Final image will be: temp.wic
Flash image to your microSD card
Please read this carefully before deployment
- Run following command in other terminal (not in docker)
- Identify microSD card partition:
lsblk, assume microSD card partition is: /dev/sdX - Unmount any partition from microSD
umount /dev/sdX - Flash Rpi4 image, modify path to Rpi4 image and microSD card partition sdX:
sudo dd if=openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img of=/dev/sdX bs=4M status=progress
or
sudo dd if=temp.wic of=/dev/sdX bs=4M status=progress
- Sync and eject
sync
sudo eject /dev/sdX
Hardware connection
Check Rpi4 pin out here (Alt4): https://pinout.xyz/pinout/jtag
| Pin name | Jtag connector | Rpi4 |
|---|---|---|
| VCC | 2 | 3v3 power |
| TRST | 3 | GPIO 22 |
| TDI | 5 | GPIO 26 |
| TMS | 7 | GPIO 27 |
| TCLK | 9 | GPIO 25 |
| RTCK | 11 | GPIO 23 |
| TDO | 13 | GPIO 24 |
| GND | 18 | Any Ground |