Tools: added files useful for hardware debugging

This commit is contained in:
Andrew Tridgell 2019-02-16 13:18:57 +11:00
parent 6b0456e3ac
commit e393828702
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,2 @@
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", SYMLINK+="ttyBmpGdb"
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg"

3
Tools/debug/README.md Normal file
View File

@ -0,0 +1,3 @@
This directory contains files that are useful for setting up to debug
ArduPilot using either a black magic probe or a stlink-v2 with openocd

View File

@ -0,0 +1,18 @@
# copy the file to .gdbinit in your Firmware tree, and adjust the path
# below to match your system
# using ttyBmpGdb is appropriate if you have setup udev to
# automatically create a link when a black magic probe is
# inserted. See 99-blackmagic.rules in this directory
target extended /dev/ttyBmpGdb
monitor swdp_scan
attach 1
#monitor vector_catch disable hard
set mem inaccessible-by-default off
set print pretty
b AP_HAL::panic
b HardFault_Handler
b chSysHalt
set confirm off

View File

@ -0,0 +1,12 @@
# copy this file to .gdbinit in your Firmware tree
# this sets up gdb to use openocd. You must start openocd first
target extended-remote :3333
set mem inaccessible-by-default off
set print pretty
b AP_HAL::panic
b HardFault_Handler
b chSysHalt
set confirm off

8
Tools/debug/openocd.cfg Normal file
View File

@ -0,0 +1,8 @@
# sample openocd config file for use with ArduPilot
# ChibiOS boards
source [find interface/stlink.cfg]
# replace the stm32f4x with the right value for
# your microcontroller
source [find target/stm32f4x.cfg]
init
$_TARGETNAME configure -rtos ChibiOS