OpenOCD
  Introduction
  Download and install
  Test your installation
  Debug requirements
  How to configure OpenOCD?
  How to use the toolchain?
  JTAG interfaces
  Support
  License information

  (2) YAGARTO
  (3) YAGARTO and Eclipse
  Back


Introduction

For a complete C/C++ development system we need the following components:

1. Open On-Chip Debugger
2. Native GNU ARM toolchain for windows
3. Integrated Development Environment

Here I will show you how to install OpenOCD with the JTAGkey USB driver from Amontec.

Note: Parallel port support is removed from this installer. You must compile a parallel port version by yourself. If you want to build OpenOCD by yourself, take a look here. Even there is a lot of work and changes in progress. If you want to contribute to OpenOCD, please take a look at the developer list.


OpenOCD, the Open On-Chip Debugger has been created by Dominic Rath as part of a diploma thesis at the University of Applied Sciences, FH-Augsburg.

I have created a windows installer which has included the OpenOCD, some make tools and the JTAGkey USB driver from Amontec.

This version of OpenOCD is now a native windows version, and does not requiere Cygwin anymore. This tutorial is toolchain independent, and should work for example with YAGARTO, WinARM, GNUARM and other toolchains.

Thanks to Spen from anglia (www.anglia.com) for providing the patch for a native windows OpenOCD.

^ top  

Download and install

The installer for OpenOCD can be downloaded from the front page. A history of the SVN changes can be found here.

After you have started the installer you must select the feature you want to install at the "Choose Components" page:

If you do not have the utilities like make, sh, rm, cp and mkdir let the checkmark selected. After you have finish the installation, we will install the driver.

How to install the driver?

If you have left the checkmark at the driver section above, you have installed the driver for the JTAGkey on your PC. Now you must "load" the driver.


JTAGkey:

For the JTAGkey take a look in the start menu "Program", here you will find the following entry:

"OpenOCD -> Amontec JTAGkey Utils xxxxxx -> Install Drivers to Windows XP"

This is the description how to install (you need Adobe Reader to read this description). Remember, the JTAGkey driver is always on your PC, you will find the driver here:

<root of openocd>\driver\jtagkey_utils_xxxxxx

^ top  

Test your installation

OpenOCD some "make-utils" are installed on your PC. Now we want to make a short test if these tools are all available. Therefore open a command prompt and type:

C:\make --version

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-mingw32

If there is no answer, probably "make-utils" was not installed or is not in your PATH.
Now test if OpenOCD is available, type:

C:\>openocd-ftd2xx -h

Open On-Chip Debugger 0.2.0-in-development (2009-05-23-14:36) svn:1888M
(snapshot 1888 from SVN tree + patch, no official release)

BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS

Open On-Chip Debugger
(c) 2005-2008 by Dominic Rath

--help |  -h display this help
--version |  -v display OpenOCD version
--file |  -f use configuration file <name>
--search |  -s dir to search for config files and scripts
--debug |  -d set debug level <0-3>
--log_output |  -l redirect log output to file <name>
--command |  -c run <command>
--pipe |  -p use pipes for gdb communication

If there is no answer, OpenOCD was not installed or is not in your PATH.

^ top  

Debug requirements

The target shoud have the standard 20-pin JTAG connector, furthermore you need a JTAG Debugger Hardware like this:


For technical information like voltage range, take a look at the corresponding web pages of the manufacturers.

For the Ethernut 3 which has a different JTAG connecter layout, you need a cable adapter.

^ top  

How to configure OpenOCD?

To configure OpenOCD, you need a configuration file which must be specified with
-f <configfile> at the command line.

Even you can use the Target library. OpenOCD comes with a target configuration script library. These scripts can be used as-is or serve as a starting point. The target library is published together with the openocd executable and the path to the target library is in the OpenOCD script search path. Similarly there are example scripts for configuring the JTAG interface. The target library is devided in the following directories:

  • interface
  • target
  • board

The command line below uses the example JTAGkey configuration scripts that ship with OpenOCD, then configures the str710.cfg target and finally issues the init and reset command. The communication speed is set to 10kHz for reset and 8MHz for post reset.

openocd -f interface/jtagkey.cfg -c "jtag_khz 10 8000" -f target/str710.cfg -c "init" -c "reset"

For more information how to configure OpenOCD please take a look in the
"Open On-Chip Debugger (OpenOCD)" manual.

^ top  

How to use the toolchain?

Now we can go to part 2 and install YAGARTO, the GNU ARM toolchain.

^ top  

Supported JTAG interfaces

The OpenOCD installer supports the following JTAG interfaces. This mean, the installer comes with the driver for the listed devices:

If you have an other interface like the following, take a look at the manufacture side:

^ top  

Support

If you need support, take a look here:

^ top  

License information

Some of the software falls under the GNU General Public License (GPL).

More Information about GPL, can be found here:

FSF - Licenses

You can download a copy of the GPL from this website, too:

gpl.txt

Some packages of the OpenOCD installer have their own version of a license. Please take a look in the corresponding directories.

^ top  


Creative Commons-Lizenz The tutorial on this site is licensed under a Creative Commons Attribution 2.5 License and is copyright (C) 2006 by me, Michael Fischer.