You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. Welcome to OpenOCD!
  2. ===================
  3. OpenOCD provides on-chip programming and debugging support with a
  4. layered architecture of JTAG interface and TAP support, debug target
  5. support (e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.).
  6. Several network interfaces are available for interactiving with OpenOCD:
  7. HTTP, telnet, TCL, and GDB. The GDB server enables OpenOCD to function
  8. as a "remote target" for source-level debugging of embedded systems
  9. using the GNU GDB program.
  10. This README file contains an overview of the following topics:
  11. - how to find and build more OpenOCD documentation,
  12. - the build process
  13. - packaging tips.
  14. - configuration options
  15. =====================
  16. OpenOCD Documentation
  17. =====================
  18. In addition to in-tree documentation, the latest documentation may be
  19. viewed on-line at the following URLs:
  20. OpenOCD User's Guide:
  21. http://openocd.berlios.de/doc/html/index.html
  22. OpenOCD Developer's Manual:
  23. http://openocd.berlios.de/doc/doxygen/index.html
  24. These reflect the latest development versions, so the following section
  25. introduces how to build the complete documentation from the package.
  26. For more information, refer to these documents or contact the developers
  27. by subscribing to the OpenOCD developer mailing list:
  28. openocd-development@lists.berlios.de
  29. Building the OpenOCD Documentation
  30. ----------------------------------
  31. The OpenOCD User's Guide can be produced in two different format:
  32. # If PDFVIEWER is set, this creates and views the PDF User Guide.
  33. make pdf && ${PDFVIEWER} doc/openocd.pdf
  34. # If HTMLVIEWER is set, this creates and views the HTML User Guide.
  35. make html && ${HTMLVIEWER} doc/openocd.html/index.html
  36. The OpenOCD Developer Manual contains information about the internal
  37. architecture and other details about the code:
  38. # NB! make sure doxygen is installed, type doxygen --version
  39. make doxygen
  40. # If HTMLVIEWER is set, this views the HTML Doxygen output.
  41. ${HTMLVIEWER} doxygen/index.html
  42. The remaining sections describe how to configure the system such that
  43. you can build the in-tree documentation.
  44. ==================
  45. Installing OpenOCD
  46. ==================
  47. On Linux, you may have permissions problems to address. The best way
  48. to do this is to use the contrib/openocd.udev rules file. It probably
  49. belongs somewhere in /etc/udev/rules.d, but consult your operating
  50. system documentation to be sure. In particular, make sure that it
  51. matches the syntax used by your operating system's version of udev.
  52. A Note to OpenOCD Users
  53. -----------------------
  54. If you would rather be working "with" OpenOCD rather than "on" it, your
  55. operating system or JTAG interface supplier may provide binaries for
  56. you in a convenient-enough package.
  57. Such packages may be more stable than git mainline, where bleeding-edge
  58. development takes place. These "Packagers" produce binary releases of
  59. OpenOCD after the developers produces new "release" versions of the
  60. source code. Previous versions of OpenOCD cannot be used to diagnose
  61. problems with the current release, so users are encouraged to keep in
  62. contact with their distribution package maintainers or interface vendors
  63. to ensure suitable upgrades appear regularly.
  64. Users of these binary versions of OpenOCD must contact their Packager to
  65. ask for support or newer versions of the binaries; the OpenOCD
  66. developers do not support packages directly.
  67. A Note to OpenOCD Packagers
  68. ---------------------------
  69. You are a PACKAGER of OpenOCD if you:
  70. - Sell dongles: and include pre-built binaries
  71. - Supply tools: A complete development solution
  72. - Supply IDEs: like Eclipse, or RHIDE, etc.
  73. - Build packages: RPM files, or DEB files for a Linux Distro
  74. As a PACKAGER, you will experience first reports of most issues.
  75. When you fix those problems for your users, your solution may help
  76. prevent hundreds (if not thousands) of other questions from other users.
  77. If something does not work for you, please work to inform the OpenOCD
  78. developers know how to improve the system or documentation to avoid
  79. future problems, and follow-up to help us ensure the issue will be fully
  80. resolved in our future releases.
  81. That said, the OpenOCD developers would also like you to follow a few
  82. suggestions:
  83. - Send patches, including config files, upstream.
  84. - Always build with printer ports enabled.
  85. - Use libftdi + libusb for FT2232 support.
  86. Remember, the FTD2XX library cannot be used in binary distributions, due
  87. to restrictions of the GPL v2.
  88. ================
  89. Building OpenOCD
  90. ================
  91. The INSTALL file contains generic instructions for running 'configure'
  92. and compiling the OpenOCD source code. That file is provided by default
  93. for all GNU automake packages. If you are not familiar with the GNU
  94. autotools, then you should read those instructions first.
  95. The remainder of this document tries to provide some instructions for
  96. those looking for a quick-install.
  97. OpenOCD Dependencies
  98. --------------------
  99. Presently, GCC is required to build OpenOCD. The developers have begun
  100. to enforce strict code warnings (-Wall, -Werror, -Wextra, and more) and
  101. use C99-specific features: inline functions, named initializers, mixing
  102. declarations with code, and other tricks. While it may be possible to
  103. use other compilers, they must be somewhat modern and could require
  104. extending support to conditionally remove GCC-specific extensions.
  105. Also, you need to install the appropriate driver files, if you want to
  106. build support for a USB or FTDI-based interface:
  107. - ft2232, jlink, rlink, vsllink, usbprog, arm-jtag-ew:
  108. - libusb: required for portable communication with USB dongles
  109. - ft2232 also requires:
  110. - libftdi: http://www.intra2net.com/opensource/ftdi/ *OR*
  111. - ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm,
  112. or the Amontec version (from http://www.amontec.com), for
  113. easier support of JTAGkey's vendor and product IDs.
  114. Many Linux distributions provide these packages through their automated
  115. installation and update mechanisms; however, some Linux versions include
  116. older versions of libftdi. In particular, using Ubuntu 8.04 has been
  117. problematic, but newer versions of Ubuntu do not have this problem.
  118. Compiling OpenOCD
  119. -----------------
  120. To build OpenOCD (on both Linux and Cygwin), use the following sequence
  121. of commands:
  122. ./configure [with some options listed in the next section]
  123. make
  124. make install
  125. The 'configure' step generates the Makefiles required to build OpenOCD,
  126. usually with one or more options provided to it. The first 'make' step
  127. will build OpenOCD and place the final executable in ./src/. The
  128. final (optional) step, ``make install'', places all of the files in the
  129. required location.
  130. Cross-Compiling Options
  131. -----------------------
  132. To cross-compile, you must specify both --build and --host options to
  133. the 'configure' script. For example, you can configure OpenOCD to
  134. cross-compile on a x86 Linux host to run on Windows (MinGW32), you could
  135. use the following configuration options:
  136. ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc ...
  137. Likewise, the following options allow OpenOCD to be cross-compiled for
  138. an ARM target on the same x86 host:
  139. ./configure --build=i686-pc-linux-gnu --host=arm-elf ...
  140. Both must be specified to work around bugs in autoconf.
  141. Scripts for producing ARM cross-compilers can be found on the web with a
  142. little searching. A script to produce an x86 Linux-hosted MinGW32
  143. cross-compiler can be downloaded from the following URL:
  144. http://www.mingw.org/wiki/LinuxCrossMinGW
  145. Configuration Options
  146. ---------------------
  147. The configure script takes numerous options, specifying which JTAG
  148. interfaces should be included (among other things). The following list
  149. of options was extracted from the output of './configure --help'. Other
  150. options may be available there:
  151. --enable-maintainer-mode enable make rules and dependencies not useful
  152. (and sometimes confusing) to the casual installer
  153. NOTE: This option is *required* for GIT builds!
  154. It should *not* be used to build a release.
  155. --enable-dummy Enable building the dummy JTAG port driver
  156. --enable-ft2232_libftdi Enable building support for FT2232 based devices
  157. using the libftdi driver, opensource alternate of
  158. FTD2XX
  159. --enable-ft2232_ftd2xx Enable building support for FT2232 based devices
  160. using the FTD2XX driver from ftdichip.com
  161. --enable-gw16012 Enable building support for the Gateworks GW16012
  162. JTAG Programmer
  163. --enable-parport Enable building the pc parallel port driver
  164. --disable-parport-ppdev Disable use of ppdev (/dev/parportN) for parport
  165. (for x86 only)
  166. --enable-parport-giveio Enable use of giveio for parport (for CygWin only)
  167. --enable-presto_libftdi Enable building support for ASIX Presto Programmer
  168. using the libftdi driver
  169. --enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
  170. using the FTD2XX driver
  171. --enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
  172. --enable-arm-jtag-ew Enable building support for the Olimex ARM-JTAG-EW
  173. Programmer
  174. --enable-jlink Enable building support for the Segger J-Link JTAG
  175. Programmer
  176. --enable-rlink Enable building support for the Raisonance RLink
  177. JTAG Programmer
  178. --enable-ulink Enable building support for the Keil ULINK JTAG
  179. Programmer
  180. --enable-usbprog Enable building support for the usbprog JTAG
  181. Programmer
  182. --enable-vsllink Enable building support for the Versaloon-Link JTAG
  183. Programmer
  184. --enable-oocd_trace Enable building support for the OpenOCD+trace ETM
  185. capture device
  186. --enable-ep93xx Enable building support for EP93xx based SBCs
  187. --enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
  188. --enable-ecosboard Enable building support for eCos based JTAG debugger
  189. --enable-zy1000 Enable ZY1000 interface
  190. --enable-minidriver-dummy
  191. Enable the dummy minidriver.
  192. --enable-ioutil Enable ioutil functions - useful for standalone
  193. OpenOCD implementations
  194. --disable-doxygen-html Disable building Doxygen manual as HTML.
  195. --enable-doxygen-pdf Enable building Doxygen manual as PDF.
  196. Miscellaneous Configure Options
  197. -------------------------------
  198. The following additional options may also be useful:
  199. --disable-assert turn off assertions
  200. --enable-verbose Enable verbose JTAG I/O messages (for debugging).
  201. --enable-verbose-jtag-io
  202. Enable verbose JTAG I/O messages (for debugging).
  203. --enable-verbose-usb-io Enable verbose USB I/O messages (for debugging)
  204. --enable-verbose-usb-comms
  205. Enable verbose USB communication messages (for
  206. debugging)
  207. --enable-malloc-logging Include free space in logging messages (requires
  208. malloc.h).
  209. --disable-gccwarnings Disable extra gcc warnings during build.
  210. --disable-wextra Disable extra compiler warnings
  211. --disable-werror Do not treat warnings as errors
  212. --disable-option-checking
  213. Ignore unrecognized --enable and --with options.
  214. --disable-dependency-tracking speeds up one-time build
  215. --enable-shared[=PKGS] build shared libraries [default=no]
  216. --enable-static[=PKGS] build static libraries [default=yes]
  217. Parallel Port Dongles
  218. ---------------------
  219. If you want to access the parallel port using the PPDEV interface you
  220. have to specify both --enable-parport AND --enable-parport-ppdev, since the
  221. the later option is an option to the parport driver (see
  222. http://forum.sparkfun.com/viewtopic.php?t=3795 for more info).
  223. The same is true for the --enable-parport-giveio option, you
  224. have to use both the --enable-parport AND the --enable-parport-giveio
  225. option if you want to use giveio instead of ioperm parallel port access
  226. method.
  227. FT2232C Based USB Dongles
  228. -------------------------
  229. There are 2 methods of using the FTD2232, either (1) using the
  230. FTDICHIP.COM closed source driver, or (2) the open (and free) driver
  231. libftdi.
  232. Using LIBFTDI
  233. -------------
  234. The libftdi source code can be download from the following website:
  235. http://www.intra2net.com/en/developer/libftdi/download.php
  236. For both Linux and Windows, both libusb and libftdi must be built and
  237. installed. To use the newer FT2232H chips, supporting RTCK and USB high
  238. speed (480 Mbps), use libftdi version 0.17 or newer. Many Linux
  239. distributions provide suitable packages for these libraries.
  240. For Windows, libftdi is supported with versions 0.14 and later.
  241. With these prerequisites met, configure the libftdi solution like this:
  242. ./configure --prefix=/path/for/your/install --enable-ft2232_libftdi
  243. Then type ``make'', and perhaps ``make install''.
  244. Using FTDI's FTD2XX
  245. -------------------
  246. The (closed source) FTDICHIP.COM solution is faster on MS-Windows. That
  247. is the motivation for supporting it even though its licensing restricts
  248. it to non-redistributable OpenOCD binaries, and it is not available for
  249. all operating systems used with OpenOCD. You may, however, build such
  250. copies for personal use.
  251. The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
  252. TAR.GZ file. You must unpack them ``some where'' convenient. As of this
  253. writing FTDICHIP does not supply means to install these files "in an
  254. appropriate place."
  255. If your distribution does not package these, there are several
  256. './configure' options to solve this problem:
  257. --with-ftd2xx-win32-zipdir
  258. Where (CYGWIN/MINGW) the zip file from ftdichip.com
  259. was unpacked <default=search>
  260. --with-ftd2xx-linux-tardir
  261. Where (Linux/Unix) the tar file from ftdichip.com
  262. was unpacked <default=search>
  263. --with-ftd2xx-lib Use static or shared ftd2xx libs on default static
  264. If you are using the FTDICHIP.COM driver, download and unpack the
  265. Windows or Linux FTD2xx drivers from the following location:
  266. http://www.ftdichip.com/Drivers/D2XX.htm
  267. Remember, this library is binary-only, while OpenOCD is licenced
  268. according to GNU GPLv2 without any exceptions. That means that
  269. _distributing_ copies of OpenOCD built with the FTDI code would violate
  270. the OpenOCD licensing terms.
  271. Linux Notes
  272. ***********
  273. The Linux tar.gz archive contains a directory named libftd2xx0.4.16
  274. (or similar). Assuming that you have extracted this archive in the same
  275. directory as the OpenOCD package, you could configure with options like
  276. the following:
  277. ./configure \
  278. --enable-ft2232_ftd2xx \
  279. --with-ft2xx-linux-tardir=../libftd2xx0.4.16 \
  280. ... other options ...
  281. Note that on Linux there is no good reason to use these FTDI binaries;
  282. they are no faster (on Linux) than libftdi, and cause licensing issues.
  283. ==========================
  284. Obtaining OpenOCD From GIT
  285. ==========================
  286. You can download the current GIT version with a GIT client of your
  287. choice from the main repository:
  288. git://openocd.git.sourceforge.net/gitroot/openocd/openocd
  289. You may prefer to use a mirror:
  290. http://repo.or.cz/r/openocd.git
  291. git://repo.or.cz/openocd.git
  292. Using the GIT command line client, you might use the following command
  293. to set up a local copy of the current repository (make sure there is no
  294. directory called "openocd" in the current directory):
  295. git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
  296. Then you can update that at your convenience using
  297. git pull
  298. There is also a gitweb interface, which you can use either to browse
  299. the repository or to download arbitrary snapshots using HTTP:
  300. http://openocd.git.sourceforge.net/git/gitweb.cgi?p=openocd/openocd
  301. http://repo.or.cz/w/openocd.git
  302. Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
  303. each at this writing.
  304. Tips For Building From a GIT Repository
  305. ---------------------------------------
  306. Building OpenOCD from a repository requires a recent version of the GNU
  307. autotools (autoconf >= 2.59 and automake >= 1.9).
  308. 1) Run './bootstrap' to create the 'configure' script and prepare
  309. the build process for your host system.
  310. 2) Run './configure --enable-maintainer-mode' with other options.