Browse Source

Tools: added files useful for hardware debugging

master
Andrew Tridgell 6 years ago
parent
commit
e393828702
  1. 2
      Tools/debug/99-blackmagic.rules
  2. 3
      Tools/debug/README.md
  3. 18
      Tools/debug/gdb-black-magic.init
  4. 12
      Tools/debug/gdb-openocd.init
  5. 8
      Tools/debug/openocd.cfg

2
Tools/debug/99-blackmagic.rules

@ -0,0 +1,2 @@ @@ -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

@ -0,0 +1,3 @@ @@ -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

18
Tools/debug/gdb-black-magic.init

@ -0,0 +1,18 @@ @@ -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

12
Tools/debug/gdb-openocd.init

@ -0,0 +1,12 @@ @@ -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

@ -0,0 +1,8 @@ @@ -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
Loading…
Cancel
Save