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.

README 15 KiB

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