Open On-Chip Debugger - OpenOCD

Open On-Chip Debugger support on OS X

Home > Robert_Rau.html
Links >Links.html

OpenOCD

Visit my other pages:

Electronic Design ToolsElectronics.html
Rocketry ApplicationsRocketry.html
Green LivingEco.html
SchematicsSchematics.html

If you have any comments or know of links I should add, please feel free to email me.

Developing Mac ApplicationsDesktopProgLinks.html
Lego StuffLego.html


OpenOCD is a software project started by Dominic Rath several years ago. It is now a open source project and the source can be downloaded from here. It now connects to several target machines through many debug/programming interfaces. A list of supported targets can be found in chapter 6 of the documentation. Below are programming/debugging interfaces that mention OS X compatibility. Instructions here (I prefer the homebrew process, see below):

http://openocd.org/doc-release/README.OSX


Don’t use a pre-compiled binary, or you will get an old versions of OpenOCD. Open OCD is updated frequently.

To install, first make sure you have the folder /usr/local. If not, create it with sudo mkdir /usr/local. Then:

sudo chown -R $(whoami) /usr/local/*

brew install --HEAD openocd


For some JTAG interfaces (like CMSIS DAP) you will also need to install the HDI API:

brew install hidapi


If you are new to building your own tools, you might want to look at my Command Line Tips page.

Bus Pirate

The Bus Pirate is accessed from a command line in a OS X terminal. When powered up all I/O lines are high impedance. From there, a bus mode can be selected to use the Bus Pirate with a specific protocol. Bus modes : 1-Wire, UART, I2C, SPI, raw 2-wire, raw 3-wire, HD44780 LCDs, MIDI, PC keyboard, DIO, JTAG.

http://dangerousprototypes.com/docs/Bus_Pirate

Bus Pirate can be purchased in the USA from:

http://www.adafruit.com/index.php?main_page=product_info&cPath=8&products_id=237

Tutorial for use on OSX:

http://hardcoreforensics.com/research-hardware/tool-setup/buspirate-v3

Bus Pirate firmware information:

http://michaldemin.wordpress.com/2010/02/27/how-to-buspirate-and-openocd/

Other Tutorial sites for OpenOCD on OS X

NoICE Debugger: http://www.noicedebugger.com/tour_arm/firstoocd.html

AVR on Egnite’s AVR based Internet Radio: http://www.ethernut.de/en/hardware/eir/jtag.html

Blog for the STM32 ARM using OpenOCD on OS X: http://www.jeffplaisance.com/2010/12/openocd-on-os-x-using-flyswatter-and.html

Summary of OpenOCD on OS X 10.5: http://code.google.com/p/usbprog-jtag/

YAGARTO ARM Tool chain using Eclipse and OpenOCD: http://www.yagarto.de/

Several articles about using the Freescale Freedom board with Eclipse & OpenOCD on non-Windows machines : http://mcuoneclipse.com/

USB to Chip Adapters compatible with OpenOCD

All FTDI Based Adapters

Many evaluation boards use a FTDI chip for USB to JTAG communications. FTDI makes two kinds of drivers, the VCP version for serial port emulation, and the D2XX version which are more general and designed for dynamic libraries. To use the JTAG features you need the D2XX version. There are compatibility issues between the two, see the FTDI read me here.

Download the D2XX version: http://www.ftdichip.com/Drivers/D2XX.htm

Embedded Programming on the Mac >MacEmbeddedLinks.html

ARM-USB-OCD

Three-in-one USB JTAG debugger - offers JTAG + RS232 (full modem signals supported) port + power supply all in one compact device.

http://www.olimex.com/dev/arm-usb-ocd.html

MSP430_detailed_instru.html

ARM GCC + gdb + OpenOCD tool chain build (without MacPorts)

Build a Texas Instruments Stellaris tool chain on OS X without using macports. Macintosh OS X.

http://www.arklyffe.com/main/2010/08/29/arm-gcc-toolchain-build/

USB-AtmelPrg: Wolfgang's Universal Interface Cable

USB-AtmelPrg is a USB-based universal interface providing all features needed when designing with programmable devices like AVR 8-bit RISCs via SPI, XILINX CPLDs and 32-bit ARMs via JTAG port.

http://www.triplespark.net/elec/pdev/usb-atmelprg/

Bus Blaster

Bus Blaster v2 is an experimental, high-speed JTAG debugger from Dangerous Prototypes.

http://www.seeedstudio.com/depot/bus-blaster-v2-jtag-debugger-p-807.html

Turtelizer

Turtelizer is an JTAG debugger from Ethernut. Its connector uses the AVR 10 pin pinout.

http://www.ethernut.de/en/hardware/turtelizer/openocd.html

Turtelizer, OPENOCD, and the Ethernut 3:

http://www.ethernut.de/en/hardware/enut3/openocd.html

Olimex ARM-USB-OCD

JTAG and serial port to work under Mac OS X using an Olimex ARM-USB-OCD.

https://rowley.zendesk.com/entries/109072-getting-jtag-and-serial-port-to-work-under-mac-os-x-using-an-olimex-arm-usb-ocd

estick-jtag

Atmel based target adapter.

http://code.google.com/p/estick-jtag/

USBProg

Bus Blaster v2 is an experimental, high-speed JTAG debugger from Dangerous Prototypes.

http://shop.embedded-projects.net/index.php?module=artikel&action=gruppe&id=22&lang=en

Flyswatter & Flyswatter2

Flyswatter support ARM and the Flyswatter2 supports ARM and MIPS.

http://www.tincantools.com/

MCU-Link and MCU-Link PRO

NXP offers the MCU-Link board, Only $12.64. The more capable MCU-Link Pro is $45.99. MCU-Link family of boards support a virtual COM port and the Pro adds energy monitoring and USB to I2C/SPI bridging. The old LPC-Link2 has been discontinued.

MCU-Link:

https://www.nxp.com/design/microcontrollers-developer-resources/lpc-microcontroller-utilities/lpc-link2:OM13054

MCU-Link-Pro:

https://www.nxp.com/design/microcontrollers-developer-resources/mcu-link-pro-debug-probe:MCU-LINK-PRO

The utility to program the LPC-Link2 is LPCScrypt, the CMSIS DAP image is build in.

https://www.nxp.com/design/microcontrollers-developer-resources/lpc-microcontroller-utilities/lpcscrypt-v2-1-1:LPCSCRYPT

Particle Debugger

Adafruit has this programmer board with connectors for power and a UART too. $30.00. https://www.adafruit.com/product/4001

To use OpenOCD as a stand-alone device programmer

I struggled with trying to program a NXP MKL27Z256VFM4 MCU. The MKL27 is a one wait state FLASH with fast multiply CORTEX M0+ MCU. This is when I learned you want a fresh build of OpenOCD from source. The 10.0 release was missing the ability to turn off the watchdog reset for the MKL... family, so programming would start and then get reset. I wrote a OpenOCD cfg file with all the interface, transport, and device information is a single cfg file. I also choose to make it the default cfg file by naming it openocd.cfg in the current directory. I choose to use a CMSIS DAP compatible programmer (The NXP LPC-Link2) which can program many ARM devices.

You can download my cfg file openocd.cfg.

Boundary Scan with OpenOCD

Boundary Scan firmware for a STM32F103C8T6

This doesn’t use OpenOCD but has a excellent description of the boundary scan process. This will work with any host with a serial port.

https://github.com/jxwleong/jtag-boundary-scan

bscan_tools

Collection of boundary scan tools for use with OpenOCD. Requires Python.

https://github.com/tomverbeure/bscan_tools

A list of useful tools for performing boundary scans via openocd

List of boundary scan tools for use with OpenOCD.

https://github.com/5inf/openocd-bs

python-boundary-scan-tools

Boundary scan tools for use with OpenOCD. Requires Python.

https://github.com/cyrozap/python-boundary-scan-tools

Raspberry Pi as a standalone programmer

Do not use a package manager or pre-compilied binaries or you will not get a recent version.

Open a terminal window and follow these steps:


sudo apt-get install git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev

git clone http://openocd.zylin.com/openocd

./bootstrap

./configure --enable-cmsis-dap --enable-jlink --enable-ftdi --enable-stlink --enable-ti-icdi --enable-ulink --enable-sysfsgpio --enable-bcm2835gpio

make

sudo make install

Raspberry Pi Computer

If you configure OpenOCD with --enable-bcm2835gpio (see above), then a Raspberry Pi can be a device programmer. $30.00 to $55.00.

https://www.adafruit.com/product/4001

STLINK-V3MINIE

ST USB Type-C to JTAG/SWD. $11.00.

https://www.adafruit.com/product/4001