4 OpenOCD provides on-chip programming and debugging support with a
5 layered architecture of JTAG interface and TAP support including:
7 - (X)SVF playback to faciliate automated boundary scan and FPGA/CPLD
9 - debug target support (e.g. ARM, MIPS): single-stepping,
10 breakpoints/watchpoints, gprof profiling, etc;
11 - flash chip drivers (e.g. CFI, NAND, internal flash);
12 - embedded TCL interpreter for easy scripting.
14 Several network interfaces are available for interacting with OpenOCD:
15 telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
16 "remote target" for source-level debugging of embedded systems using
17 the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
20 This README file contains an overview of the following topics:
22 - quickstart instructions,
23 - how to find and build more OpenOCD documentation,
24 - list of the supported hardware,
25 - the installation and build process,
29 ============================
30 Quickstart for the impatient
31 ============================
33 If you have a popular board then just start OpenOCD with its config,
36 openocd -f board/stm32f4discovery.cfg
38 If you are connecting a particular adapter with some specific target,
39 you need to source both the jtag interface and the target configs,
42 openocd -f interface/ftdi/jtagkey2.cfg -c "transport select jtag" \
43 -f target/ti_calypso.cfg
45 openocd -f interface/stlink-v2-1.cfg -c "transport select hla_swd" \
48 NB: when using an FTDI-based adapter you should prefer configs in the
49 ftdi directory; the old configs for the ft2232 are deprecated.
51 After OpenOCD startup, connect GDB with
53 (gdb) target extended-remote localhost:3333
60 In addition to the in-tree documentation, the latest manuals may be
61 viewed online at the following URLs:
64 http://openocd.org/doc/html/index.html
66 OpenOCD Developer's Manual:
67 http://openocd.org/doc/doxygen/html/index.html
69 These reflect the latest development versions, so the following section
70 introduces how to build the complete documentation from the package.
72 For more information, refer to these documents or contact the developers
73 by subscribing to the OpenOCD developer mailing list:
75 openocd-devel@lists.sourceforge.net
77 Building the OpenOCD Documentation
78 ----------------------------------
80 By default the OpenOCD build process prepares documentation in the
81 "Info format" and installs it the standard way, so that "info openocd"
84 Additionally, the OpenOCD User's Guide can be produced in the
85 following different formats:
87 # If PDFVIEWER is set, this creates and views the PDF User Guide.
88 make pdf && ${PDFVIEWER} doc/openocd.pdf
90 # If HTMLVIEWER is set, this creates and views the HTML User Guide.
91 make html && ${HTMLVIEWER} doc/openocd.html/index.html
93 The OpenOCD Developer Manual contains information about the internal
94 architecture and other details about the code:
96 # NB! make sure doxygen is installed, type doxygen --version
97 make doxygen && ${HTMLVIEWER} doxygen/index.html
107 AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432,
108 BCM2835, Bus Blaster, Buspirate, Chameleon, CMSIS-DAP, Cortino, DENX,
109 Digilent JTAG-SMT2, DLC 5, DLP-USB1232H, embedded projects, eStick,
110 FlashLINK, FlossJTAG, Flyswatter, Flyswatter2, Gateworks, Hoegl, ICDI,
111 ICEBear, J-Link, JTAG VPI, JTAGkey, JTAGkey2, JTAG-lock-pick, KT-Link,
112 Lisa/L, LPC1768-Stick, MiniModule, NGX, NXHX, OOCDLink, Opendous,
113 OpenJTAG, Openmoko, OpenRD, OSBDM, Presto, Redbee, RLink, SheevaPlug
114 devkit, Stellaris evkits, ST-LINK (SWO tracing supported),
115 STM32-PerformanceStick, STR9-comStick, sysfsgpio, TUMPA, Turtelizer,
116 ULINK, USB-A9260, USB-Blaster, USB-JTAG, USBprog, VPACLink, VSLLink,
117 Wiggler, XDS100v2, Xverve.
122 ARM11, ARM7, ARM9, AVR32, Cortex-A, Cortex-R, Cortex-M,
123 Feroceon/Dragonite, DSP563xx, DSP5680xx, FA526, MIPS EJTAG, NDS32,
129 ADUC702x, AT91SAM, AVR, CFI, DSP5680xx, EFM32, EM357, FM3, FM4, Kinetis,
130 LPC8xx/LPC1xxx/LPC2xxx/LPC541xx, LPC2900, LPCSPIFI, Marvell QSPI,
131 Milandr, NIIET, NuMicro, PIC32mx, PSoC4, SiM3x, Stellaris, STM32, STMSMI,
132 STR7x, STR9x, nRF51; NAND controllers of AT91SAM9, LPC3180, LPC32xx,
133 i.MX31, MXC, NUC910, Orion/Kirkwood, S3C24xx, S3C6400, XMC4xxx.
140 A Note to OpenOCD Users
141 -----------------------
143 If you would rather be working "with" OpenOCD rather than "on" it, your
144 operating system or JTAG interface supplier may provide binaries for
145 you in a convenient-enough package.
147 Such packages may be more stable than git mainline, where
148 bleeding-edge development takes place. These "Packagers" produce
149 binary releases of OpenOCD after the developers produces new "release"
150 versions of the source code. Previous versions of OpenOCD cannot be
151 used to diagnose problems with the current release, so users are
152 encouraged to keep in contact with their distribution package
153 maintainers or interface vendors to ensure suitable upgrades appear
156 Users of these binary versions of OpenOCD must contact their Packager to
157 ask for support or newer versions of the binaries; the OpenOCD
158 developers do not support packages directly.
160 A Note to OpenOCD Packagers
161 ---------------------------
163 You are a PACKAGER of OpenOCD if you:
165 - Sell dongles and include pre-built binaries;
166 - Supply tools or IDEs (a development solution integrating OpenOCD);
167 - Build packages (e.g. RPM or DEB files for a GNU/Linux distribution).
169 As a PACKAGER, you will experience first reports of most issues.
170 When you fix those problems for your users, your solution may help
171 prevent hundreds (if not thousands) of other questions from other users.
173 If something does not work for you, please work to inform the OpenOCD
174 developers know how to improve the system or documentation to avoid
175 future problems, and follow-up to help us ensure the issue will be fully
176 resolved in our future releases.
178 That said, the OpenOCD developers would also like you to follow a few
181 - Send patches, including config files, upstream, participate in the
183 - Enable all the options OpenOCD supports, even those unrelated to your
185 - Use "ftdi" interface adapter driver for the FTDI-based devices.
187 As a PACKAGER, never link against the FTD2XX library, as the resulting
188 binaries can't be legally distributed, due to the restrictions of the
196 The INSTALL file contains generic instructions for running 'configure'
197 and compiling the OpenOCD source code. That file is provided by
198 default for all GNU autotools packages. If you are not familiar with
199 the GNU autotools, then you should read those instructions first.
201 The remainder of this document tries to provide some instructions for
202 those looking for a quick-install.
207 GCC or Clang is currently required to build OpenOCD. The developers
208 have begun to enforce strict code warnings (-Wall, -Werror, -Wextra,
209 and more) and use C99-specific features: inline functions, named
210 initializers, mixing declarations with code, and other tricks. While
211 it may be possible to use other compilers, they must be somewhat
212 modern and could require extending support to conditionally remove
213 GCC-specific extensions.
219 - pkg-config >= 0.23 (or compatible)
221 Additionally, for building from git:
227 USB-based adapters depend on libusb-1.0 and some older drivers require
228 libusb-0.1 or libusb-compat-0.1. A compatible implementation, such as
229 FreeBSD's, additionally needs the corresponding .pc files.
231 USB-Blaster, ASIX Presto, OpenJTAG and ft2232 interface adapter
232 drivers need either one of:
233 - libftdi: http://www.intra2net.com/en/developer/libftdi/index.php
234 - ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm (proprietary,
237 CMSIS-DAP support needs HIDAPI library.
239 Permissions delegation
240 ----------------------
242 Running OpenOCD with root/administrative permissions is strongly
243 discouraged for security reasons.
245 For USB devices on GNU/Linux you should use the contrib/99-openocd.rules
246 file. It probably belongs somewhere in /etc/udev/rules.d, but
247 consult your operating system documentation to be sure. Do not forget
248 to add yourself to the "plugdev" group.
250 For parallel port adapters on GNU/Linux and FreeBSD please change your
251 "ppdev" (parport* or ppi*) device node permissions accordingly.
253 For parport adapters on Windows you need to run install_giveio.bat
254 (it's also possible to use "ioperm" with Cygwin instead) to give
255 ordinary users permissions for accessing the "LPT" registers directly.
260 To build OpenOCD, use the following sequence of commands:
262 ./bootstrap (when building from the git repository)
263 ./configure [options]
267 The 'configure' step generates the Makefiles required to build
268 OpenOCD, usually with one or more options provided to it. The first
269 'make' step will build OpenOCD and place the final executable in
270 './src/'. The final (optional) step, ``make install'', places all of
271 the files in the required location.
273 To see the list of all the supported options, run
276 Cross-compiling Options
277 -----------------------
279 Cross-compiling is supported the standard autotools way, you just need
280 to specify the cross-compiling target triplet in the --host option,
281 e.g. for cross-building for Windows 32-bit with MinGW on Debian:
283 ./configure --host=i686-w64-mingw32 [options]
285 To make pkg-config work nicely for cross-compiling, you might need an
286 additional wrapper script as described at
288 http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/cross-compiling.html
290 This is needed to tell pkg-config where to look for the target
291 libraries that OpenOCD depends on. Alternatively, you can specify
292 *_CFLAGS and *_LIBS environment variables directly, see "./configure
293 --help" for the details.
295 Parallel Port Dongles
296 ---------------------
298 If you want to access the parallel port using the PPDEV interface you
299 have to specify both --enable-parport AND --enable-parport-ppdev, since the
300 the later option is an option to the parport driver.
302 The same is true for the --enable-parport-giveio option, you have to
303 use both the --enable-parport AND the --enable-parport-giveio option
304 if you want to use giveio instead of ioperm parallel port access
310 The (closed source) FTDICHIP.COM solution is faster than libftdi on
311 Windows. That is the motivation for supporting it even though its
312 licensing restricts it to non-redistributable OpenOCD binaries, and it
313 is not available for all operating systems used with OpenOCD. You may,
314 however, build such copies for personal use.
316 The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
317 TAR.GZ file. You must unpack them ``some where'' convenient. As of this
318 writing FTDICHIP does not supply means to install these files "in an
321 You should use the following ./configure options to make use of
324 --with-ftd2xx-win32-zipdir
325 Where (CYGWIN/MINGW) the zip file from ftdichip.com
326 was unpacked <default=search>
327 --with-ftd2xx-linux-tardir
328 Where (Linux/Unix) the tar file from ftdichip.com
329 was unpacked <default=search>
330 --with-ftd2xx-lib=(static|shared)
331 Use static or shared ftd2xx libs (default is static)
333 Remember, this library is binary-only, while OpenOCD is licenced
334 according to GNU GPLv2 without any exceptions. That means that
335 _distributing_ copies of OpenOCD built with the FTDI code would
336 violate the OpenOCD licensing terms.
338 Note that on Linux there is no good reason to use these FTDI binaries;
339 they are no faster (on Linux) than libftdi, and cause licensing issues.
342 ==========================
343 Obtaining OpenOCD From GIT
344 ==========================
346 You can download the current GIT version with a GIT client of your
347 choice from the main repository:
349 git://git.code.sf.net/p/openocd/code
351 You may prefer to use a mirror:
353 http://repo.or.cz/r/openocd.git
354 git://repo.or.cz/openocd.git
356 Using the GIT command line client, you might use the following command
357 to set up a local copy of the current repository (make sure there is no
358 directory called "openocd" in the current directory):
360 git clone git://git.code.sf.net/p/openocd/code openocd
362 Then you can update that at your convenience using
366 There is also a gitweb interface, which you can use either to browse
367 the repository or to download arbitrary snapshots using HTTP:
369 http://repo.or.cz/w/openocd.git
371 Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
372 each at this writing.