Overview
A bit about OpenOCD and the tools we need in order to use it.
This tutorial will go over how to do in-circuit debugging with OpenOCD via JTAG.
Page
1
of
3.
OpenOCD (Open On Chip Debugger) is an open source tool by Dominic Rath that allows for breakpoint debugging of the Make Controller, and many other microcontrollers. With a piece of JTAG hardware and the open source Eclipse development environment, we can get set up to do single step break pointing in code written on the Make Controller for free.
Note: this tutorial is a bit of a work in progress. There is definitely scope for improving some of the configuration, etc.
One of the big caveats is that this is a Windows-centric setup at the moment. Ideally, OpenOCD and the requisite Eclipse plug-ins should be able to be compiled to run on OS X and other *nix platforms as well, but currently the pre-built releases of these programs support mainly Windows. Sorry. If you have some success building them for other platforms, please let us know!
In setting up to debug the Make Controller with open source tools, there are a few other resources and tutorials that are also quite useful:
Now, on to the setup.
This tutorial will detail how to get OpenOCD set up using the ARM-USB-OCD JTAG device from Olimex. OpenOCD supports a handful of other JTAG devices as well, but this seems to be one of the nicer ones, and works over both serial and USB connections. At the time of this writing, these devices are available for about $72 from SparkFun.

Olimex's ARM-USB-OCD debugger
Eclipse is normally a Java development environment, but there are many, many plugins that extend its functionality to other languages and much more. There is an extension called CDT (C Development Tools) that allows for C/C++ development in Eclipse, which would normally be all we'd need to build firmware for the Make Controller. However, to debug it we need to grab a modified version of CDT that incorporates the debugging functionality. This was contributed by Zylin - thanks!
If you haven't already installed the YAGARTO tools, check the Build Firmware on Windows how-to. In addition to those installations, we'll also need to install OpenOCD itself.
Once you've installed all of these, we're ready to move on an set up our tools in Eclipse.
Note: this tutorial is a bit of a work in progress. There is definitely scope for improving some of the configuration, etc.
One of the big caveats is that this is a Windows-centric setup at the moment. Ideally, OpenOCD and the requisite Eclipse plug-ins should be able to be compiled to run on OS X and other *nix platforms as well, but currently the pre-built releases of these programs support mainly Windows. Sorry. If you have some success building them for other platforms, please let us know!
In setting up to debug the Make Controller with open source tools, there are a few other resources and tutorials that are also quite useful:
- From Michael Fishcer's YAGARTO site - http://www.yagarto.de/howto/yagarto2/index.html
- Using Open Source Tools for AT91SAM7 Cross Development - Revision B guide by Jim Lynch
- The OpenOCD blog and developer site
- The Eclipse site
Now, on to the setup.
Hardware
Before we can do anything at all, we need the device that allows our PC to connect to the debug port on the Make Controller. The JTAG debug port is the 2x10 pin connector near the USB port.This tutorial will detail how to get OpenOCD set up using the ARM-USB-OCD JTAG device from Olimex. OpenOCD supports a handful of other JTAG devices as well, but this seems to be one of the nicer ones, and works over both serial and USB connections. At the time of this writing, these devices are available for about $72 from SparkFun.
Olimex's ARM-USB-OCD debugger
Downloads
There are a handful of downloads that will be necessary for us to get up and running. Fortunately, they each have an installer, so it's pretty easy to get set up.Eclipse is normally a Java development environment, but there are many, many plugins that extend its functionality to other languages and much more. There is an extension called CDT (C Development Tools) that allows for C/C++ development in Eclipse, which would normally be all we'd need to build firmware for the Make Controller. However, to debug it we need to grab a modified version of CDT that incorporates the debugging functionality. This was contributed by Zylin - thanks!
If you haven't already installed the YAGARTO tools, check the Build Firmware on Windows how-to. In addition to those installations, we'll also need to install OpenOCD itself.
Once you've installed all of these, we're ready to move on an set up our tools in Eclipse.

