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

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)