gdbserver: code cleanup
[openocd.git] / README
1 Welcome to OpenOCD!
2 ===================
3
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.
11
12 This README file contains an overview of the following topics:
13 - how to find and build more OpenOCD documentation,
14 - the build process
15 - packaging tips.
16 - configuration options
17
18 =====================
19 OpenOCD Documentation
20 =====================
21
22 In addition to in-tree documentation, the latest documentation may be
23 viewed on-line at the following URLs:
24
25 OpenOCD User's Guide:
26 http://openocd.sourceforge.net/doc/html/index.html
27
28 OpenOCD Developer's Manual:
29 http://openocd.sourceforge.net/doc/doxygen/html/index.html
30
31 These reflect the latest development versions, so the following section
32 introduces how to build the complete documentation from the package.
33
34
35 For more information, refer to these documents or contact the developers
36 by subscribing to the OpenOCD developer mailing list:
37
38 openocd-devel@lists.sourceforge.net
39
40 Building the OpenOCD Documentation
41 ----------------------------------
42
43 The OpenOCD User's Guide can be produced in two different format:
44
45 # If PDFVIEWER is set, this creates and views the PDF User Guide.
46 make pdf && ${PDFVIEWER} doc/openocd.pdf
47
48 # If HTMLVIEWER is set, this creates and views the HTML User Guide.
49 make html && ${HTMLVIEWER} doc/openocd.html/index.html
50
51 The OpenOCD Developer Manual contains information about the internal
52 architecture and other details about the code:
53
54 # NB! make sure doxygen is installed, type doxygen --version
55 make doxygen
56
57 # If HTMLVIEWER is set, this views the HTML Doxygen output.
58 ${HTMLVIEWER} doxygen/index.html
59
60 The remaining sections describe how to configure the system such that
61 you can build the in-tree documentation.
62
63 ==================
64 Installing OpenOCD
65 ==================
66
67 On Linux, you may have permissions problems to address. The best way
68 to do this is to use the contrib/openocd.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.
72
73 A Note to OpenOCD Users
74 -----------------------
75
76 If you would rather be working "with" OpenOCD rather than "on" it, your
77 operating system or JTAG interface supplier may provide binaries for
78 you in a convenient-enough package.
79
80 Such packages may be more stable than git mainline, where bleeding-edge
81 development takes place. These "Packagers" produce binary releases of
82 OpenOCD after the developers produces new "release" versions of the
83 source code. Previous versions of OpenOCD cannot be used to diagnose
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.
87
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.
91
92 A Note to OpenOCD Packagers
93 ---------------------------
94
95 You are a PACKAGER of OpenOCD if you:
96
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
101
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.
105
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.
110
111 That said, the OpenOCD developers would also like you to follow a few
112 suggestions:
113
114 - Send patches, including config files, upstream.
115 - Always build with printer ports enabled.
116 - Use libftdi + libusb for FT2232 support.
117
118 Remember, the FTD2XX library cannot be used in binary distributions, due
119 to restrictions of the GPL v2.
120
121 ================
122 Building OpenOCD
123 ================
124
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.
129
130 The remainder of this document tries to provide some instructions for
131 those looking for a quick-install.
132
133 OpenOCD Dependencies
134 --------------------
135
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.
142
143 Also, you need to install the appropriate driver files, if you want to
144 build support for a USB or FTDI-based interface:
145
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.
153
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.
158
159 Compiling OpenOCD
160 -----------------
161
162 To build OpenOCD (on both Linux and Cygwin), use the following sequence
163 of commands:
164
165 ./configure [with some options listed in the next section]
166 make
167 make install
168
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
173 required location.
174
175 Cross-Compiling Options
176 -----------------------
177
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:
182
183 ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc ...
184
185 Likewise, the following options allow OpenOCD to be cross-compiled for
186 an ARM target on the same x86 host:
187
188 ./configure --build=i686-pc-linux-gnu --host=arm-elf ...
189
190 Both must be specified to work around bugs in autoconf.
191
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:
195
196 http://www.mingw.org/wiki/LinuxCrossMinGW
197
198 Configuration Options
199 ---------------------
200
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:
205
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 GIT builds!
209 It should *not* be used to build a release.
210
211 --enable-dummy Enable building the dummy JTAG port driver
212
213 --enable-parport Enable building the pc parallel port driver
214 --disable-parport-ppdev Disable use of ppdev (/dev/parportN) for parport
215 (for x86 only)
216 --enable-parport-giveio Enable use of giveio for parport (for CygWin only)
217
218
219 --enable-ft2232_libftdi Enable building support for FT2232 based devices
220 using the libftdi driver, opensource alternate of
221 FTD2XX
222 --enable-ft2232_ftd2xx Enable building support for FT2232 based devices
223 using the FTD2XX driver from ftdichip.com
224
225 --enable-usb_blaster_libftdi
226 Enable building support for the Altera USB-Blaster
227 using the libftdi driver, opensource alternate of
228 FTD2XX
229 --enable-usb_blaster_ftd2xx
230 Enable building support for the Altera USB-Blaster
231 using the FTD2XX driver from ftdichip.com
232
233 --enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
234
235 --enable-zy1000-master Use ZY1000 JTAG master registers
236 --enable-zy1000 Enable ZY1000 interface
237
238 --enable-ioutil Enable ioutil functions - useful for standalone
239 OpenOCD implementations
240
241 --enable-ep93xx Enable building support for EP93xx based SBCs
242
243 --enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
244
245 --enable-gw16012 Enable building support for the Gateworks GW16012
246 JTAG Programmer
247
248 --enable-presto_libftdi Enable building support for ASIX Presto Programmer
249 using the libftdi driver
250 --enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
251 using the FTD2XX driver
252
253 --enable-usbprog Enable building support for the usbprog JTAG
254 Programmer
255
256 --enable-oocd_trace Enable building support for some prototype
257 OpenOCD+trace ETM capture hardware
258
259 --enable-jlink Enable building support for the Segger J-Link JTAG
260 Programmer
261
262 --enable-vsllink Enable building support for the Versaloon-Link JTAG
263 Programmer
264
265 --enable-rlink Enable building support for the Raisonance RLink
266 JTAG Programmer
267 --enable-ulink Enable building support for the Keil ULINK JTAG
268 Programmer
269 --enable-arm-jtag-ew Enable building support for the Olimex ARM-JTAG-EW
270 Programmer
271
272 --enable-buspirate Enable building support for the Buspirate
273
274 --enable-stlink Enable building support for the ST-Link JTAG
275 Programmer
276
277 --enable-osbdm Enable building support for the OSBDM (JTAG only)
278 Programmer
279
280 --enable-opendous Enable building support for the estick/opendous JTAG
281 Programmer
282
283 --enable-minidriver-dummy
284 Enable the dummy minidriver.
285
286 --disable-internal-jimtcl
287 Disable building internal jimtcl
288 --enable-libusb0 Use libusb-0.1 library for USB JTAG devices
289 --enable-remote-bitbang Enable building support for the Remote Bitbang jtag
290 driver
291
292 --disable-doxygen-html Disable building Doxygen manual as HTML.
293 --enable-doxygen-pdf Enable building Doxygen manual as PDF.
294
295 Miscellaneous Configure Options
296 -------------------------------
297
298 The following additional options may also be useful:
299
300 --disable-assert turn off assertions
301
302 --enable-verbose Enable verbose JTAG I/O messages (for debugging).
303 --enable-verbose-jtag-io
304 Enable verbose JTAG I/O messages (for debugging).
305 --enable-verbose-usb-io Enable verbose USB I/O messages (for debugging)
306 --enable-verbose-usb-comms
307 Enable verbose USB communication messages (for
308 debugging)
309 --enable-malloc-logging Include free space in logging messages (requires
310 malloc.h).
311
312 --disable-gccwarnings Disable extra gcc warnings during build.
313 --disable-wextra Disable extra compiler warnings
314 --disable-werror Do not treat warnings as errors
315
316 --disable-option-checking
317 Ignore unrecognized --enable and --with options.
318 --disable-dependency-tracking speeds up one-time build
319 --enable-shared[=PKGS] build shared libraries [default=no]
320 --enable-static[=PKGS] build static libraries [default=yes]
321
322 Parallel Port Dongles
323 ---------------------
324
325 If you want to access the parallel port using the PPDEV interface you
326 have to specify both --enable-parport AND --enable-parport-ppdev, since the
327 the later option is an option to the parport driver (see
328 http://forum.sparkfun.com/viewtopic.php?t=3795 for more info).
329
330 The same is true for the --enable-parport-giveio option, you
331 have to use both the --enable-parport AND the --enable-parport-giveio
332 option if you want to use giveio instead of ioperm parallel port access
333 method.
334
335 FT2232C Based USB Dongles
336 -------------------------
337
338 There are 2 methods of using the FTD2232, either (1) using the
339 FTDICHIP.COM closed source driver, or (2) the open (and free) driver
340 libftdi.
341
342 Using LIBFTDI
343 -------------
344
345 The libftdi source code can be download from the following website:
346
347 http://www.intra2net.com/en/developer/libftdi/download.php
348
349 For both Linux and Windows, both libusb and libftdi must be built and
350 installed. To use the newer FT2232H chips, supporting RTCK and USB high
351 speed (480 Mbps), use libftdi version 0.17 or newer. Many Linux
352 distributions provide suitable packages for these libraries.
353
354 For Windows, libftdi is supported with versions 0.14 and later.
355
356 With these prerequisites met, configure the libftdi solution like this:
357
358 ./configure --prefix=/path/for/your/install --enable-ft2232_libftdi
359
360 Then type ``make'', and perhaps ``make install''.
361
362 Using FTDI's FTD2XX
363 -------------------
364
365 The (closed source) FTDICHIP.COM solution is faster on MS-Windows. That
366 is the motivation for supporting it even though its licensing restricts
367 it to non-redistributable OpenOCD binaries, and it is not available for
368 all operating systems used with OpenOCD. You may, however, build such
369 copies for personal use.
370
371 The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
372 TAR.GZ file. You must unpack them ``some where'' convenient. As of this
373 writing FTDICHIP does not supply means to install these files "in an
374 appropriate place."
375
376 If your distribution does not package these, there are several
377 './configure' options to solve this problem:
378
379 --with-ftd2xx-win32-zipdir
380 Where (CYGWIN/MINGW) the zip file from ftdichip.com
381 was unpacked <default=search>
382 --with-ftd2xx-linux-tardir
383 Where (Linux/Unix) the tar file from ftdichip.com
384 was unpacked <default=search>
385 --with-ftd2xx-lib Use static or shared ftd2xx libs on default static
386
387 If you are using the FTDICHIP.COM driver, download and unpack the
388 Windows or Linux FTD2xx drivers from the following location:
389
390 http://www.ftdichip.com/Drivers/D2XX.htm
391
392 Remember, this library is binary-only, while OpenOCD is licenced
393 according to GNU GPLv2 without any exceptions. That means that
394 _distributing_ copies of OpenOCD built with the FTDI code would violate
395 the OpenOCD licensing terms.
396
397 Linux Notes
398 ***********
399
400 The Linux tar.gz archive contains a directory named libftd2xx0.4.16
401 (or similar). Assuming that you have extracted this archive in the same
402 directory as the OpenOCD package, you could configure with options like
403 the following:
404
405 ./configure \
406 --enable-ft2232_ftd2xx \
407 --with-ft2xx-linux-tardir=../libftd2xx0.4.16 \
408 ... other options ...
409
410 Note that on Linux there is no good reason to use these FTDI binaries;
411 they are no faster (on Linux) than libftdi, and cause licensing issues.
412
413 ==========================
414 Obtaining OpenOCD From GIT
415 ==========================
416
417 You can download the current GIT version with a GIT client of your
418 choice from the main repository:
419
420 git://openocd.git.sourceforge.net/gitroot/openocd/openocd
421
422 You may prefer to use a mirror:
423
424 http://repo.or.cz/r/openocd.git
425 git://repo.or.cz/openocd.git
426
427 Using the GIT command line client, you might use the following command
428 to set up a local copy of the current repository (make sure there is no
429 directory called "openocd" in the current directory):
430
431 git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
432
433 Then you can update that at your convenience using
434
435 git pull
436
437 There is also a gitweb interface, which you can use either to browse
438 the repository or to download arbitrary snapshots using HTTP:
439
440 http://openocd.git.sourceforge.net/git/gitweb.cgi?p=openocd/openocd
441 http://repo.or.cz/w/openocd.git
442
443 Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
444 each at this writing.
445
446
447 Tips For Building From a GIT Repository
448 ---------------------------------------
449
450 Building OpenOCD from a repository requires a recent version of the GNU
451 autotools (autoconf >= 2.59 and automake >= 1.9).
452
453 1) Run './bootstrap' to create the 'configure' script and prepare
454 the build process for your host system.
455
456 2) Run './configure --enable-maintainer-mode' with other options.

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)