4 OpenOCD provides on-chip programming and debugging support with a
5 layered architecture of JTAG interface and TAP support, debug target
6 support (e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.).
7 Several network interfaces are available for interactiving with OpenOCD:
8 HTTP, telnet, TCL, and GDB. The GDB server enables OpenOCD to function
9 as a "remote target" for source-level debugging of embedded systems
10 using the GNU GDB program.
12 This README file contains an overview of the following topics:
13 - how to find and build more OpenOCD documentation,
16 - configuration options
22 In addition to in-tree documentation, the latest documentation may be
23 viewed on-line at the following URLs:
26 http://openocd.berlios.de/doc/html/index.html
28 OpenOCD Developer's Manual:
29 http://openocd.berlios.de/doc/doxygen/index.html
31 These reflect the latest development versions, so the following section
32 introduces how to build the complete documentation from the package.
35 For more information, refer to these documents or contact the developers
36 by subscribing to the OpenOCD developer mailing list:
38 openocd-development@lists.berlios.de
40 Building the OpenOCD Documentation
41 ----------------------------------
43 The OpenOCD User's Guide can be produced in two different format:
45 # If PDFVIEWER is set, this creates and views the PDF User Guide.
46 make pdf && ${PDFVIEWER} doc/openocd.pdf
48 # If HTMLVIEWER is set, this creates and views the HTML User Guide.
49 make html && ${HTMLVIEWER} doc/openocd.html/index.html
51 The OpenOCD Developer Manual contains information about the internal
52 architecture and other details about the code:
54 # NB! make sure doxygen is installed, type doxygen --version
57 # If HTMLVIEWER is set, this views the HTML Doxygen output.
58 ${HTMLVIEWER} doxygen/index.html
60 The remaining sections describe how to configure the system such that
61 you can build the in-tree documentation.
67 On Linux, you may have permissions problems to address. The best
68 way to do this is to use the contrib/udev.rules file. It probably
69 belongs somewhere in /etc/udev/rules.d, but consult your operating
70 system documentation to be sure. In particular, make sure that it
71 matches the syntax used by your operating system's version of udev.
73 A Note to OpenOCD Users
74 -----------------------
76 If you would rather be working "with" OpenOCD rather than "on" it, your
77 operating system or interface supplier may provide binaries for you in a
80 Such packages should be more stable than SVN trunk, where bleeding-edge
81 development takes place. These "Packagers" produce binary releases of
82 OpenOCD after the developers produces new "stable" versions of the
83 source code. Previous versions of OpenOCD cannot be used to diagnosed
84 problems with the current release, so users are encouraged to keep in
85 contact with their distribution package maintainers or interface vendors
86 to ensure suitable upgrades appear regularly.
88 Users of these binary versions of OpenOCD must contact their Packager to
89 ask for support or newer versions of the binaries; the OpenOCD
90 developers do not support packages directly.
92 A Note to OpenOCD Packagers
93 ---------------------------
95 You are a PACKAGER of OpenOCD if you:
97 - Sell dongles: and include pre-built binaries
98 - Supply tools: A complete development solution
99 - Supply IDEs: like Eclipse, or RHIDE, etc.
100 - Build packages: RPM files, or DEB files for a Linux Distro
102 As a PACKAGER, you will experience first reports of most issues.
103 When you fix those problems for your users, your solution may help
104 prevent hundreds (if not thousands) of other questions from other users.
106 If something does not work for you, please work to inform the OpenOCD
107 developers know how to improve the system or documentation to avoid
108 future problems, and follow-up to help us ensure the issue will be fully
109 resolved in our future releases.
111 That said, the OpenOCD developers would also like you to follow a few
114 - Send patches, including config files, upstream.
115 - Always build with printer ports enabled.
116 - Use libftdi + libusb for FT2232 support.
118 Remember, the FTD2XX library cannot be used in binary distributions, due
119 to restrictions of the GPL v2.
125 The INSTALL file contains generic instructions for running 'configure'
126 and compiling the OpenOCD source code. That file is provided by default
127 for all GNU automake packages. If you are not familiar with the GNU
128 autotools, then you should read those instructions first.
130 The remainder of this document tries to provide some instructions for
131 those looking for a quick-install.
136 Presently, GCC is required to build OpenOCD. The developers have begun
137 to enforce strict code warnings (-Wall, -Werror, -Wextra, and more) and
138 use C99-specific features: inline functions, named initializers, mixing
139 declarations with code, and other tricks. While it may be possible to
140 use other compilers, they must be somewhat modern and could require
141 extending support to conditionally remove GCC-specific extensions.
143 Also, you need to install the appropriate driver files, if you want to
144 build support for a USB or FTDI-based interface:
146 - ft2232, jlink, rlink, vsllink, usbprog, arm-jtag-ew:
147 - libusb: required for portable communication with USB dongles
148 - ft2232 also requires:
149 - libftdi: http://www.intra2net.com/opensource/ftdi/ *OR*
150 - ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm,
151 or the Amontec version (from http://www.amontec.com), for
152 easier support of JTAGkey's vendor and product IDs.
154 Many Linux distributions provide these packages through their automated
155 installation and update mechanisms; however, some Linux versions include
156 older versions of libftdi. In particular, using Ubuntu 8.04 has been
157 problematic, but newer versions of Ubuntu do not have this problem.
162 To build OpenOCD (on both Linux and Cygwin), use the following sequence
165 ./configure [with some options listed in the next section]
169 The 'configure' step generates the Makefiles required to build OpenOCD,
170 usually with one or more options provided to it. The first 'make' step
171 will build OpenOCD and place the final executable in ./src/. The
172 final (optional) step, ``make install'', places all of the files in the
175 Cross-Compiling Options
176 -----------------------
178 To cross-compile, you must specify both --build and --host options to
179 the 'configure' script. For example, you can configure OpenOCD to
180 cross-compile on a x86 Linux host to run on Windows (MinGW32), you could
181 use the following configuration options:
183 ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc ...
185 Likewise, the following options allow OpenOCD to be cross-compiled for
186 an ARM target on the same x86 host:
188 ./configure --build=i686-pc-linux-gnu --host=arm-elf ...
190 Both must be specified to work around bugs in autoconf.
192 Scripts for producing ARM cross-compilers can be found on the web with a
193 little searching. A script to produce an x86 Linux-hosted MinGW32
194 cross-compiler can be downloaded from the following URL:
196 http://www.mingw.org/wiki/LinuxCrossMinGW
198 Configuration Options
199 ---------------------
201 The configure script takes numerous options, specifying which JTAG
202 interfaces should be included (among other things). The following list
203 of options was extracted from the output of './configure --help'. Other
204 options may be available there:
206 --enable-maintainer-mode enable make rules and dependencies not useful
207 (and sometimes confusing) to the casual installer
208 NOTE: This option is *required* for SVN builds!
209 It should *not* be used to build a release.
211 --enable-dummy Enable building the dummy JTAG port driver
213 --enable-ft2232_libftdi Enable building support for FT2232 based devices
214 using the libftdi driver, opensource alternate of
216 --enable-ft2232_ftd2xx Enable building support for FT2232 based devices
217 using the FTD2XX driver from ftdichip.com
219 --enable-gw16012 Enable building support for the Gateworks GW16012
222 --enable-parport Enable building the pc parallel port driver
223 --disable-parport-ppdev Disable use of ppdev (/dev/parportN) for parport
225 --enable-parport-giveio Enable use of giveio for parport (for CygWin only)
227 --enable-presto_libftdi Enable building support for ASIX Presto Programmer
228 using the libftdi driver
229 --enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
230 using the FTD2XX driver
232 --enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
233 --enable-arm-jtag-ew Enable building support for the Olimex ARM-JTAG-EW
235 --enable-jlink Enable building support for the Segger J-Link JTAG
237 --enable-rlink Enable building support for the Raisonance RLink
239 --enable-usbprog Enable building support for the usbprog JTAG
241 --enable-vsllink Enable building support for the Versaloon-Link JTAG
244 --enable-oocd_trace Enable building support for the OpenOCD+trace ETM
247 --enable-ep93xx Enable building support for EP93xx based SBCs
248 --enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
250 --enable-ecosboard Enable building support for eCos based JTAG debugger
251 --enable-zy1000 Enable ZY1000 interface
253 --enable-minidriver-dummy
254 Enable the dummy minidriver.
256 --enable-ioutil Enable ioutil functions - useful for standalone
257 OpenOCD implementations
258 --enable-httpd Enable builtin httpd server - useful for standalone
259 OpenOCD implementations
261 Miscellaneous Configure Options
262 -------------------------------
264 The following additional options may also be useful:
266 --disable-assert turn off assertions
268 --enable-verbose Enable verbose JTAG I/O messages (for debugging).
269 --enable-verbose-jtag-io
270 Enable verbose JTAG I/O messages (for debugging).
271 --enable-verbose-usb-io Enable verbose USB I/O messages (for debugging)
272 --enable-verbose-usb-comms
273 Enable verbose USB communication messages (for
275 --enable-malloc-logging Include free space in logging messages (requires
278 --disable-gccwarnings Disable extra gcc warnings during build.
279 --disable-wextra Disable extra compiler warnings
280 --disable-werror Do not treat warnings as errors
282 --disable-option-checking
283 Ignore unrecognized --enable and --with options.
284 --disable-dependency-tracking speeds up one-time build
285 --enable-shared[=PKGS] build shared libraries [default=no]
286 --enable-static[=PKGS] build static libraries [default=yes]
288 Parallel Port Dongles
289 ---------------------
291 If you want to access the parallel port using the PPDEV interface you
292 have to specify both --enable-parport AND --enable-parport-ppdev, since the
293 the later option is an option to the parport driver (see
294 http://forum.sparkfun.com/viewtopic.php?t=3795 for more info).
296 The same is true for the --enable-parport-giveio option, you
297 have to use both the --enable-parport AND the --enable-parport-giveio
298 option if you want to use giveio instead of ioperm parallel port access
301 FT2232C Based USB Dongles
302 -------------------------
304 There are 2 methods of using the FTD2232, either (1) using the
305 FTDICHIP.COM closed source driver, or (2) the open (and free) driver
311 The libftdi source code can be download from the following website:
313 http://www.intra2net.com/en/developer/libftdi/download.php
315 For both Linux and Windows, both libusb and libftdi must be built and
316 installed. To use the newer FT2232H chips, supporting RTCK and USB high
317 speed (480 Mbps), you need libftdi version 0.16 or newer. Many Linux
318 distributions provide suitable packages for these libraries.
320 For Windows, libftdi is supported with versions 0.14 and later.
322 With these prerequisites met, configure the libftdi solution like this:
324 ./configure --prefix=/path/for/your/install --enable-ft2232_libftdi
326 Then type ``make'', and perhaps ``make install''.
331 The (closed source) FTDICHIP.COM solution is faster on MS-Windows. That
332 is the motivation for supporting it even though its licensing restricts
333 it to non-redistributable OpenOCD binaries, and it is not available for
334 all operating systems used with OpenOCD. You may, however, build such
335 copies for personal use.
337 The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
338 TAR.GZ file. You must unpack them ``some where'' convient. As of this
339 writing FTDICHIP does not supply means to install these files "in an
342 If your distribution does not package these, there are several
343 './configure' options to solve this problem:
345 --with-ftd2xx-win32-zipdir
346 Where (CYGWIN/MINGW) the zip file from ftdichip.com
347 was unpacked <default=search>
348 --with-ftd2xx-linux-tardir
349 Where (Linux/Unix) the tar file from ftdichip.com
350 was unpacked <default=search>
351 --with-ftd2xx-lib Use static or shared ftd2xx libs on default static
353 If you are using the FTDICHIP.COM driver, download and unpack the
354 Windows or Linux FTD2xx drivers from the following location:
356 http://www.ftdichip.com/Drivers/D2XX.htm
358 Remember, this library is binary-only, while OpenOCD is licenced
359 according to GNU GPLv2 without any exceptions. That means that
360 _distributing_ copies of OpenOCD built with the FTDI code would violate
361 the OpenOCD licensing terms.
366 The Linux tar.gz archive contains a directory named libftd2xx0.4.16
367 (or similar). Assuming that you have extracted this archive in the same
368 directory as the OpenOCD package, you could configure with options like
372 --enable-ft2232_ftd2xx \
373 --with-ft2xx-linux-tardir=../libftd2xx0.4.16 \
374 ... other options ...
376 Note that on Linux there is no good reason to use these FTDI binaries;
377 they are no faster (on Linux) than libftdi, and cause licensing issues.
379 =================================
380 Obtaining OpenOCD From Subversion
381 ---------------------------------
383 You can download the current SVN version with an SVN client of your
384 choice from the following repositories:
386 svn://svn.berlios.de/openocd/trunk
388 http://svn.berlios.de/svnroot/repos/openocd/trunk
390 Using the SVN command line client, you can use the following command to
391 fetch the latest version (make sure there is no (non-svn) directory
392 called "openocd" in the current directory):
394 svn checkout svn://svn.berlios.de/openocd/trunk openocd
396 If you prefer GIT based tools, the git-svn package works too:
398 git svn clone -s svn://svn.berlios.de/openocd
400 Tips For Building From The Subversion Repository
401 ************************************************
403 Building OpenOCD from a repository requires a recent version of the GNU
404 autotools (autoconf >= 2.59 and automake >= 1.9).
406 1) Run './bootstrap' to create the 'configure' script and prepare
407 the build process for your host system.
409 2) Run './configure --enable-maintainer-mode' with other options.