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.


  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:
  22. OpenOCD Developer's Manual:
  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:
  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
  48. way to do this is to use the contrib/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 interface supplier may provide binaries for you in a
  56. convenient package.
  57. Such packages should be more stable than SVN trunk, where bleeding-edge
  58. development takes place. These "Packagers" produce binary releases of
  59. OpenOCD after the developers produces new "stable" versions of the
  60. source code. Previous versions of OpenOCD cannot be used to diagnosed
  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: *OR*
  111. - ftd2xx:,
  112. or the Amontec version (from, 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:
  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 SVN 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
  161. --enable-ftd2xx-highspeed
  162. Enable building support for FT2232H and
  163. FT4232H-based devices (requires >=libftd2xx-0.4.16)
  164. --enable-gw16012 Enable building support for the Gateworks GW16012
  165. JTAG Programmer
  166. --enable-parport Enable building the pc parallel port driver
  167. --disable-parport-ppdev Disable use of ppdev (/dev/parportN) for parport
  168. (for x86 only)
  169. --enable-parport-giveio Enable use of giveio for parport (for CygWin only)
  170. --enable-presto_libftdi Enable building support for ASIX Presto Programmer
  171. using the libftdi driver
  172. --enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
  173. using the FTD2XX driver
  174. --enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
  175. --enable-arm-jtag-ew Enable building support for the Olimex ARM-JTAG-EW
  176. Programmer
  177. --enable-jlink Enable building support for the Segger J-Link JTAG
  178. Programmer
  179. --enable-rlink Enable building support for the Raisonance RLink
  180. JTAG Programmer
  181. --enable-usbprog Enable building support for the usbprog JTAG
  182. Programmer
  183. --enable-vsllink Enable building support for the Versaloon-Link JTAG
  184. Programmer
  185. --enable-oocd_trace Enable building support for the OpenOCD+trace ETM
  186. capture device
  187. --enable-ep93xx Enable building support for EP93xx based SBCs
  188. --enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
  189. --enable-ecosboard Enable building support for eCos based JTAG debugger
  190. --enable-zy1000 Enable ZY1000 interface
  191. --enable-minidriver-dummy
  192. Enable the dummy minidriver.
  193. --enable-ioutil Enable ioutil functions - useful for standalone
  194. OpenOCD implementations
  195. --enable-httpd Enable builtin httpd server - useful for standalone
  196. OpenOCD implementations
  197. Miscellaneous Configure Options
  198. -------------------------------
  199. The following additional options may also be useful:
  200. --disable-assert turn off assertions
  201. --enable-verbose Enable verbose JTAG I/O messages (for debugging).
  202. --enable-verbose-jtag-io
  203. Enable verbose JTAG I/O messages (for debugging).
  204. --enable-verbose-usb-io Enable verbose USB I/O messages (for debugging)
  205. --enable-verbose-usb-comms
  206. Enable verbose USB communication messages (for
  207. debugging)
  208. --enable-malloc-logging Include free space in logging messages (requires
  209. malloc.h).
  210. --disable-gccwarnings Disable extra gcc warnings during build.
  211. --disable-wextra Disable extra compiler warnings
  212. --disable-werror Do not treat warnings as errors
  213. --disable-option-checking
  214. Ignore unrecognized --enable and --with options.
  215. --disable-dependency-tracking speeds up one-time build
  216. --enable-shared[=PKGS] build shared libraries [default=no]
  217. --enable-static[=PKGS] build static libraries [default=yes]
  218. Parallel Port Dongles
  219. ---------------------
  220. If you want to access the parallel port using the PPDEV interface you
  221. have to specify both --enable-parport AND --enable-parport-ppdev, since the
  222. the later option is an option to the parport driver (see
  223. for more info).
  224. The same is true for the --enable-parport-giveio option, you
  225. have to use both the --enable-parport AND the --enable-parport-giveio
  226. option if you want to use giveio instead of ioperm parallel port access
  227. method.
  228. FT2232C Based USB Dongles
  229. -------------------------
  230. There are 2 methods of using the FTD2232, either (1) using the
  231. FTDICHIP.COM closed source driver, or (2) the open (and free) driver
  232. libftdi.
  233. Using LIBFTDI
  234. -------------
  235. The libftdi source code can be download from the following website:
  237. For both Linux and Windows, both libusb and libftdi must be built and
  238. installed. To use the newer FT2232H chips, supporting RTCK and USB high
  239. speed (480 Mbps), you need libftdi version 0.16 or newer. Many Linux
  240. distributions provide suitable packages for these libraries.
  241. For Windows, libftdi is supported with versions 0.14 and later.
  242. With these prerequisites met, configure the libftdi solution like this:
  243. ./configure --prefix=/path/for/your/install --enable-ft2232_libftdi
  244. Then type ``make'', and perhaps ``make install''.
  245. Using FTDI's FTD2XX
  246. -------------------
  247. The (closed source) FTDICHIP.COM solution is faster on MS-Windows. That
  248. is the motivation for supporting it even though its licensing restricts
  249. it to non-redistributable OpenOCD binaries, and it is not available for
  250. all operating systems used with OpenOCD. You may, however, build such
  251. copies for personal use.
  252. The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
  253. TAR.GZ file. You must unpack them ``some where'' convient. As of this
  254. writing FTDICHIP does not supply means to install these files "in an
  255. appropriate place."
  256. If your distribution does not package these, there are several
  257. './configure' options to solve this problem:
  258. --with-ftd2xx-win32-zipdir
  259. Where (CYGWIN/MINGW) the zip file from
  260. was unpacked <default=search>
  261. --with-ftd2xx-linux-tardir
  262. Where (Linux/Unix) the tar file from
  263. was unpacked <default=search>
  264. --with-ftd2xx-lib Use static or shared ftd2xx libs on default static
  265. If you are using the FTDICHIP.COM driver, download and unpack the
  266. Windows or Linux FTD2xx drivers from the following location:
  268. Remember, this library is binary-only, while OpenOCD is licenced
  269. according to GNU GPLv2 without any exceptions. That means that
  270. _distributing_ copies of OpenOCD built with the FTDI code would violate
  271. the OpenOCD licensing terms.
  272. Linux Notes
  273. ***********
  274. The Linux tar.gz archive contains a directory named libftd2xx0.4.16
  275. (or similar). Assuming that you have extracted this archive in the same
  276. directory as the OpenOCD package, you could configure with options like
  277. the following:
  278. ./configure \
  279. --enable-ft2232_ftd2xx \
  280. --with-ft2xx-linux-tardir=../libftd2xx0.4.16 \
  281. ... other options ...
  282. Note that on Linux there is no good reason to use these FTDI binaries;
  283. they are no faster (on Linux) than libftdi, and cause licensing issues.
  284. =================================
  285. Obtaining OpenOCD From Subversion
  286. ---------------------------------
  287. You can download the current SVN version with an SVN client of your
  288. choice from the following repositories:
  289. svn://
  290. or
  292. Using the SVN command line client, you can use the following command to
  293. fetch the latest version (make sure there is no (non-svn) directory
  294. called "openocd" in the current directory):
  295. svn checkout svn:// openocd
  296. If you prefer GIT based tools, the git-svn package works too:
  297. git svn clone -s svn://
  298. Tips For Building From The Subversion Repository
  299. ************************************************
  300. Building OpenOCD from a repository requires a recent version of the GNU
  301. autotools (autoconf >= 2.59 and automake >= 1.9).
  302. 1) Run './bootstrap' to create the 'configure' script and prepare
  303. the build process for your host system.
  304. 2) Run './configure --enable-maintainer-mode' with other options.