-
Notifications
You must be signed in to change notification settings - Fork 0
OpenOCD
OpenOCD (the open on-chip debugger) is an open source tool for debugging and flashing microcontrollers. In RIOT we try to use this tool for as many platforms as possible to reduce the overhead of having to keep track of many different (and sometimes proprietary) tools.
Many of the boards supported by RIOT use top-edge hardware that is only supported by very recent versions of OpenOCD. The OpenOCD versions that come with Linux distributions (e.g. 0.7.0 in Mint 17) are mostly not up-to-date. For this reason we recommend that you manually build the current upstream version.
The following steps are for building and installing OpenOCD under Linux Mint 17. But this howto should work unchanged also for recent Ubuntu versions. For other Linux distributions the steps have to slightly altered, Windows is TODO.
- Install prerequisites
sudo apt-get install build-essential autoconf automake libtool libusb-dev libusb-1.0-0-dev libhidapi-dev
- Clone the OpenOCD git repository
git clone git://git.code.sf.net/p/openocd/code openocd
- Switch into the directory
cd openocd
- Bootstrap the build envoronment
./bootstrap
- Call configure. Make sure all devices are put to
yes
in the configuration summary
./configure
- Build the thing
make
- Install it
sudo make install
- Test if everything worked out properly
openocd --version
This should give you the version you have just build, probably something like 0.9.0-dev-xxxx
. Voila, thats it!
- Using homebrew one can install the most recent version of openocd by
brew install openocd --HEAD
- Test if everything worked out properly
openocd --version
This should give you the version you have just build, probably something like 0.9.0-dev-xxxx
. Voila, thats it!
When using OpenOCD on Mac OS X and you encounter an error similar to
Error: libusb_claim_interface() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with vid 0403, pid 6010, description '*' and serial '*'
make sure you are running make flash
with sudo
and that the system ftdi driver is unloaded:
From OpenOCD documentation ( source ):
If you're using a USB adapter and have a driver kext matched to it,
you will need to unload it prior to running OpenOCD. E.g. with Apple
driver (OS X 10.9 or later) for FTDI run:
sudo kextunload -b com.apple.driver.AppleUSBFTDI
for FTDI vendor driver use:
sudo kextunload FTDIUSBSerialDriver.kext
To figure out if a board is supported by OpenOCD it's best to a look on the scripts that come with OpenOCD. On Ubuntu/Mint these are put into /usr/local/share/openocd/scripts/
.
When using OpenOCD on Linux and you encounter something similar to
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description 'FITECO M3' and serial '*'
in procedure 'init'
chances are you have to configure udev rules to work with the device.
When built from source, OpenOCD provides examples in contrib/99-openocd.rules
. Copy this
file to your udev configuration directory make sure your vid
and pid
are covered and
adjust the GROUP
to some group you are part of.
RIOT - The friendly Operating System for the Internet of Things
Homepage | [GitHub] (https://github.com/RIOT-OS/) | Developers Mailing List | Users Mailing List | Twitter @RIOT_OS
- Family: ARM
- Board: Airfy Beacon
- Board: Arduino Due
- Board: CC2538DK
- Board: HikoB Fox
- Board: IoT LAB M3
- Board: LimiFrog-v1
- Board: mbed_lpc1768
- Board: MSB-IoT
- Board: MSBA2
- Board: Nucleo-L1
- Board: Nucleo-F334
- Board: Nucleo-F303
- Board: Nucleo-F091
- Board: Mulle
- Board: OpenMote
- Board: PCA1000x (nRF51822 Development Kit)
- Board: Phytec phyWAVE-KW22
- Board: RFduino
- Board: Samr21 xpro
- Board: Spark Core
- Board: STM32F0discovery
- Board: STM32F3discovery
- Board: STM32F4discovery
- Board: UDOO
- Board: yunjia-nrf51822
- Family: ATmega
- Board: Arduino Mega2560
- Family: MSP430
- Board: MSB-430H
- Board: TelosB
- Board: WSN430
- Board: Zolertia Z1
- Board: eZ430-Chronos
- Family: native
- Board: native
- Family: x86
- Board: Intel Galileo