-
Notifications
You must be signed in to change notification settings - Fork 767
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* openocd script and readme * do not disable SWD on boot
- Loading branch information
1 parent
130092e
commit d2d207b
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
sudo openocd -f "interface/stlink.cfg" -c "transport select hla_swd" -f "target/stm32h7x.cfg" -c "init" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters