OpenOCD based debugging

(Please, would the first person that uses these instructions send me an email? I'd like to know about success or failure - preferably with details that can be used to fix this wiki. -kevinh@geeksvile.com)

Selecting an adapter

I used this adapter from olimex.

Tt is likely that other STM32 supported adapters would work. I suspect that if you buy this and this you'd be able to debug a PX4 for under $50.

Building OpenOCD

The version of openocd included in Ubuntu 13.10 (and other OSes) may be a bit old. The minimum version of OpenOCD we recommend is 0.7.0. If the 'standard' version for your platform is lower than this, you'll need to build it from source.

Build instructions follow: Download openocd 0.7.0 from http://openocd.sourceforge.net/

cd openocd 
./configure --enable-ft2232_libftdi
make
sudo make install
sudo modprobe ftdi_sio # May be needed if you have blacklisted this driver for some reason 

Debugging with OpenOCD and eclipse

First start OpenOCD

cd Firmware
Debug/runopenocd.sh

Then launch GDB using the special GDB init script

cd Firmware
arm-none-eabi-gdb -x Debug/openocd.gdbinit makefiles/build/firmware.elf 
Translations of this page:


Quick Links

QR Code: URL of current page