README* refactoring
[openocd.git] / README
blob0781dfc42044352d7b137d14944cb5f4155c6231
1 Welcome to OpenOCD!
2 ===================
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
8   programming;
9 - debug target support (e.g. ARM, MIPS): single-stepping,
10   breakpoints/watchpoints, etc;
11 - flash chip drivers (e.g. CFI, NAND, internal flash);
12 - embedded TCL intepreter 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
18 Pro).
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,
26 - packaging tips.
29 ============================
30 Quickstart for the impatient
31 ============================
33 If you have a popular board then just start OpenOCD with its config,
34 e.g.:
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,
40 e.g.:
42   openocd -f interface/ftdi/jtagkey2.cfg -f target/ti_calypso.cfg
44 NB: when using an FTDI-based adapter you should prefer configs in the
45 ftdi directory; the old configs for the ft2232 are deprecated.
47 After OpenOCD startup, connect GDB with
49   (gdb) target extended-remote localhost:3333
52 =====================
53 OpenOCD Documentation
54 =====================
56 In addition to the in-tree documentation, the latest manuals may be
57 viewed online at the following URLs:
59   OpenOCD User's Guide:
60     http://openocd.sourceforge.net/doc/html/index.html
62   OpenOCD Developer's Manual:
63     http://openocd.sourceforge.net/doc/doxygen/html/index.html
65 These reflect the latest development versions, so the following section
66 introduces how to build the complete documentation from the package.
68 For more information, refer to these documents or contact the developers
69 by subscribing to the OpenOCD developer mailing list:
71         openocd-devel@lists.sourceforge.net
73 Building the OpenOCD Documentation
74 ----------------------------------
76 By default the OpenOCD build process prepares documentation in the
77 "Info format" and installs it the standard way, so that "info openocd"
78 can access it.
80 Additionally, the OpenOCD User's Guide can be produced in the
81 following different formats:
83   # If PDFVIEWER is set, this creates and views the PDF User Guide.
84   make pdf && ${PDFVIEWER} doc/openocd.pdf
86   # If HTMLVIEWER is set, this creates and views the HTML User Guide.
87   make html && ${HTMLVIEWER} doc/openocd.html/index.html
89 The OpenOCD Developer Manual contains information about the internal
90 architecture and other details about the code:
92   # NB! make sure doxygen is installed, type doxygen --version
93   make doxygen && ${HTMLVIEWER} doxygen/index.html
96 ==================
97 Supported hardware
98 ==================
100 JTAG adapters
101 -------------
103 AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432,
104 BCM2835, Bus Blaster, Buspirate, Chameleon, Cortino, DLC 5,
105 DLP-USB1232H, embedded projects, eStick, FlashLINK, FlossJTAG,
106 Flyswatter, Flyswatter2, Hoegl, ICDI, ICEBear, J-Link, JTAGkey,
107 JTAGkey2, JTAG-lock-pick, KT-Link, Lisa/L, LPC1768-Stick, MiniModule,
108 NGX, NXHX, OOCDLink, Opendous, OpenJTAG, Openmoko, OpenRD, OSBDM,
109 Presto, Redbee, RLink, SheevaPlug devkit, Stellaris evkits, ST-LINK,
110 STM32-PerformanceStick, STR9-comStick, sysfsgpio, TUMPA, Turtelizer,
111 ULINK, USB-A9260, USB-Blaster, USB-JTAG, USBprog, VPACLink, VSLLink,
112 Wiggler, XDS100v2, Xverve.
114 Debug targets
115 -------------
117 ARM11, ARM7, ARM9, AVR32, Cortex-A, Cortex-R, Cortex-M,
118 Feroceon/Dragonite, DSP563xx, DSP5680xx, FA526, MIPS EJTAG, NDS32,
119 XScale.
121 Flash drivers
122 -------------
124 ADUC702x, AT91SAM, AVR, CFI, DSP5680xx, EFM32, EM357, FM3, Kinetis,
125 LPC2000, LPC2900, LPCSPIFI, PIC32mx, Stellaris, STM32, STMSMI, STR7x,
126 STR9x; NAND controllers of AT91SAM9, LPC3180, LPC32xx, i.MX31, MXC,
127 NUC910, Orion/Kirkwood, S3C24xx, S3C6400.
130 ==================
131 Installing OpenOCD
132 ==================
134 A Note to OpenOCD Users
135 -----------------------
137 If you would rather be working "with" OpenOCD rather than "on" it, your
138 operating system or JTAG interface supplier may provide binaries for
139 you in a convenient-enough package.
141 Such packages may be more stable than git mainline, where
142 bleeding-edge development takes place. These "Packagers" produce
143 binary releases of OpenOCD after the developers produces new "release"
144 versions of the source code. Previous versions of OpenOCD cannot be
145 used to diagnose problems with the current release, so users are
146 encouraged to keep in contact with their distribution package
147 maintainers or interface vendors to ensure suitable upgrades appear
148 regularly.
150 Users of these binary versions of OpenOCD must contact their Packager to
151 ask for support or newer versions of the binaries; the OpenOCD
152 developers do not support packages directly.
154 A Note to OpenOCD Packagers
155 ---------------------------
157 You are a PACKAGER of OpenOCD if you:
159 - Sell dongles and include pre-built binaries;
160 - Supply tools or IDEs (a development solution integrating OpenOCD);
161 - Build packages (e.g. RPM or DEB files for a GNU/Linux distribution).
163 As a PACKAGER, you will experience first reports of most issues.
164 When you fix those problems for your users, your solution may help
165 prevent hundreds (if not thousands) of other questions from other users.
167 If something does not work for you, please work to inform the OpenOCD
168 developers know how to improve the system or documentation to avoid
169 future problems, and follow-up to help us ensure the issue will be fully
170 resolved in our future releases.
172 That said, the OpenOCD developers would also like you to follow a few
173 suggestions:
175 - Send patches, including config files, upstream, participate in the
176   discussions;
177 - Enable all the options OpenOCD supports, even those unrelated to your
178   particular hardware;
179 - Use "ftdi" interface adapter driver for the FTDI-based devices.
181 As a PACKAGER, never link against the FTD2XX library, as the resulting
182 binaries can't be legally distributed, due to the restrictions of the
183 GPL.
186 ================
187 Building OpenOCD
188 ================
190 The INSTALL file contains generic instructions for running 'configure'
191 and compiling the OpenOCD source code. That file is provided by
192 default for all GNU autotools packages. If you are not familiar with
193 the GNU autotools, then you should read those instructions first.
195 The remainder of this document tries to provide some instructions for
196 those looking for a quick-install.
198 OpenOCD Dependencies
199 --------------------
201 GCC or Clang is currently required to build OpenOCD. The developers
202 have begun to enforce strict code warnings (-Wall, -Werror, -Wextra,
203 and more) and use C99-specific features: inline functions, named
204 initializers, mixing declarations with code, and other tricks. While
205 it may be possible to use other compilers, they must be somewhat
206 modern and could require extending support to conditionally remove
207 GCC-specific extensions.
209 You'll also need:
211 - make
212 - libtool
214 Additionally, for building from git:
216 - autoconf >= 2.59
217 - automake >= 1.9
218 - texinfo
220 USB-based adapters depend on libusb-1.0 and some older drivers require
221 libusb-0.1 or libusb-compat-0.1.
223 USB-Blaster, ASIX Presto, OpenJTAG and ft2232 interface adapter
224 drivers need either one of:
225   - libftdi: http://www.intra2net.com/en/developer/libftdi/index.php
226   - ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm (proprietary,
227     GPL-incompatible)
229 Permissions delegation
230 ----------------------
232 Running OpenOCD with root/administrative permissions is strongly
233 discouraged for security reasons.
235 For USB devices on GNU/Linux you should use the contrib/openocd.udev
236 rules file. It probably belongs somewhere in /etc/udev/rules.d, but
237 consult your operating system documentation to be sure. Do not forget
238 to add yourself to the "plugdev" group.
240 For parallel port adapters on GNU/Linux and FreeBSD please change your
241 "ppdev" (parport* or ppi*) device node permissions accordingly.
243 For parport adapters on Windows you need to run install_giveio.bat
244 (it's also possible to use "ioperm" with Cygwin instead) to give
245 ordinary users permissions for accessing the "LPT" registers directly.
247 Compiling OpenOCD
248 -----------------
250 To build OpenOCD, use the following sequence of commands:
252   ./bootstrap (when building from the git repository)
253   ./configure [options]
254   make
255   sudo make install
257 The 'configure' step generates the Makefiles required to build
258 OpenOCD, usually with one or more options provided to it. The first
259 'make' step will build OpenOCD and place the final executable in
260 './src/'. The final (optional) step, ``make install'', places all of
261 the files in the required location.
263 To see the list of all the supported options, run
264   ./configure --help
266 Cross-compiling Options
267 -----------------------
269 Cross-compiling is supported the standard autotools way, you just need
270 to specify the cross-compiling target triplet in the --host option,
271 e.g. for cross-building for Windows 32-bit with MinGW on Debian:
273   ./configure --host=i686-w64-mingw32 [options]
275 Parallel Port Dongles
276 ---------------------
278 If you want to access the parallel port using the PPDEV interface you
279 have to specify both --enable-parport AND --enable-parport-ppdev, since the
280 the later option is an option to the parport driver.
282 The same is true for the --enable-parport-giveio option, you have to
283 use both the --enable-parport AND the --enable-parport-giveio option
284 if you want to use giveio instead of ioperm parallel port access
285 method.
287 Using FTDI's FTD2XX
288 -------------------
290 The (closed source) FTDICHIP.COM solution is faster than libftdi on
291 Windows. That is the motivation for supporting it even though its
292 licensing restricts it to non-redistributable OpenOCD binaries, and it
293 is not available for all operating systems used with OpenOCD. You may,
294 however, build such copies for personal use.
296 The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
297 TAR.GZ file. You must unpack them ``some where'' convenient. As of this
298 writing FTDICHIP does not supply means to install these files "in an
299 appropriate place."
301 You should use the following ./configure options to make use of
302 FTD2XX:
304   --with-ftd2xx-win32-zipdir
305                           Where (CYGWIN/MINGW) the zip file from ftdichip.com
306                           was unpacked <default=search>
307   --with-ftd2xx-linux-tardir
308                           Where (Linux/Unix) the tar file from ftdichip.com
309                           was unpacked <default=search>
310   --with-ftd2xx-lib=(static|shared)
311                           Use static or shared ftd2xx libs (default is static)
313 Remember, this library is binary-only, while OpenOCD is licenced
314 according to GNU GPLv2 without any exceptions. That means that
315 _distributing_ copies of OpenOCD built with the FTDI code would
316 violate the OpenOCD licensing terms.
318 Note that on Linux there is no good reason to use these FTDI binaries;
319 they are no faster (on Linux) than libftdi, and cause licensing issues.
322 ==========================
323 Obtaining OpenOCD From GIT
324 ==========================
326 You can download the current GIT version with a GIT client of your
327 choice from the main repository:
329    git://git.code.sf.net/p/openocd/code
331 You may prefer to use a mirror:
333    http://repo.or.cz/r/openocd.git
334    git://repo.or.cz/openocd.git
336 Using the GIT command line client, you might use the following command
337 to set up a local copy of the current repository (make sure there is no
338 directory called "openocd" in the current directory):
340    git clone git://git.code.sf.net/p/openocd/code openocd
342 Then you can update that at your convenience using
344    git pull
346 There is also a gitweb interface, which you can use either to browse
347 the repository or to download arbitrary snapshots using HTTP:
349    http://repo.or.cz/w/openocd.git
351 Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
352 each at this writing.