mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-16 06:42:12 +08:00
4012d181e1
date: 2024-03-17T10:14:38 master commit: 7e9a909e0e57ecb31df4c87c5b9a06b1204fd034
In-circuit debugging using openocd and gdb
Hardware
Connect an ST-Link V2 programmer to the SWD pins on the board. The pins that need to be connected are:
- GND
- VTref
- SWDIO
- SWCLK
- NRST
Make sure you're using a genuine one for boards that do not have a 3.3V panda power rail. For example, the tres runs at 1.8V, which is not supported by the clones.
Openocd
Install openocd. For Ubuntu 20.04, the one in the package manager works fine: sudo apt install openocd.
To run, use ./debug_f4.sh (TODO) or ./debug_h7.sh depending on the panda.
GDB
You need gdb-multiarch.
Once openocd is running, you can connect from gdb as follows:
$ gdb-multiarch
(gdb) target ext :3333
To reset and break, use monitor reset halt.