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 12 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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 including:
  5. - (X)SVF playback to faciliate automated boundary scan and FPGA/CPLD
  6. programming;
  7. - debug target support (e.g. ARM, MIPS): single-stepping,
  8. breakpoints/watchpoints, etc;
  9. - flash chip drivers (e.g. CFI, NAND, internal flash);
  10. - embedded TCL intepreter for easy scripting.
  11. Several network interfaces are available for interacting with OpenOCD:
  12. telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
  13. "remote target" for source-level debugging of embedded systems using
  14. the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
  15. Pro).
  16. This README file contains an overview of the following topics:
  17. - quickstart instructions,
  18. - how to find and build more OpenOCD documentation,
  19. - list of the supported hardware,
  20. - the installation and build process,
  21. - packaging tips.
  22. ============================
  23. Quickstart for the impatient
  24. ============================
  25. If you have a popular board then just start OpenOCD with its config,
  26. e.g.:
  27. openocd -f board/stm32f4discovery.cfg
  28. If you are connecting a particular adapter with some specific target,
  29. you need to source both the jtag interface and the target configs,
  30. e.g.:
  31. openocd -f interface/ftdi/jtagkey2.cfg -f target/ti_calypso.cfg
  32. NB: when using an FTDI-based adapter you should prefer configs in the
  33. ftdi directory; the old configs for the ft2232 are deprecated.
  34. After OpenOCD startup, connect GDB with
  35. (gdb) target extended-remote localhost:3333
  36. =====================
  37. OpenOCD Documentation
  38. =====================
  39. In addition to the in-tree documentation, the latest manuals may be
  40. viewed online at the following URLs:
  41. OpenOCD User's Guide:
  42. http://openocd.sourceforge.net/doc/html/index.html
  43. OpenOCD Developer's Manual:
  44. http://openocd.sourceforge.net/doc/doxygen/html/index.html
  45. These reflect the latest development versions, so the following section
  46. introduces how to build the complete documentation from the package.
  47. For more information, refer to these documents or contact the developers
  48. by subscribing to the OpenOCD developer mailing list:
  49. openocd-devel@lists.sourceforge.net
  50. Building the OpenOCD Documentation
  51. ----------------------------------
  52. By default the OpenOCD build process prepares documentation in the
  53. "Info format" and installs it the standard way, so that "info openocd"
  54. can access it.
  55. Additionally, the OpenOCD User's Guide can be produced in the
  56. following different formats:
  57. # If PDFVIEWER is set, this creates and views the PDF User Guide.
  58. make pdf && ${PDFVIEWER} doc/openocd.pdf
  59. # If HTMLVIEWER is set, this creates and views the HTML User Guide.
  60. make html && ${HTMLVIEWER} doc/openocd.html/index.html
  61. The OpenOCD Developer Manual contains information about the internal
  62. architecture and other details about the code:
  63. # NB! make sure doxygen is installed, type doxygen --version
  64. make doxygen && ${HTMLVIEWER} doxygen/index.html
  65. ==================
  66. Supported hardware
  67. ==================
  68. JTAG adapters
  69. -------------
  70. AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432,
  71. BCM2835, Bus Blaster, Buspirate, Chameleon, Cortino, DLC 5,
  72. DLP-USB1232H, embedded projects, eStick, FlashLINK, FlossJTAG,
  73. Flyswatter, Flyswatter2, Hoegl, ICDI, ICEBear, J-Link, JTAGkey,
  74. JTAGkey2, JTAG-lock-pick, KT-Link, Lisa/L, LPC1768-Stick, MiniModule,
  75. NGX, NXHX, OOCDLink, Opendous, OpenJTAG, Openmoko, OpenRD, OSBDM,
  76. Presto, Redbee, RLink, SheevaPlug devkit, Stellaris evkits, ST-LINK,
  77. STM32-PerformanceStick, STR9-comStick, sysfsgpio, TUMPA, Turtelizer,
  78. ULINK, USB-A9260, USB-Blaster, USB-JTAG, USBprog, VPACLink, VSLLink,
  79. Wiggler, XDS100v2, Xverve.
  80. Debug targets
  81. -------------
  82. ARM11, ARM7, ARM9, AVR32, Cortex-A, Cortex-R, Cortex-M,
  83. Feroceon/Dragonite, DSP563xx, DSP5680xx, FA526, MIPS EJTAG, NDS32,
  84. XScale.
  85. Flash drivers
  86. -------------
  87. ADUC702x, AT91SAM, AVR, CFI, DSP5680xx, EFM32, EM357, FM3, Kinetis,
  88. LPC2000, LPC2900, LPCSPIFI, PIC32mx, Stellaris, STM32, STMSMI, STR7x,
  89. STR9x; NAND controllers of AT91SAM9, LPC3180, LPC32xx, i.MX31, MXC,
  90. NUC910, Orion/Kirkwood, S3C24xx, S3C6400.
  91. ==================
  92. Installing OpenOCD
  93. ==================
  94. A Note to OpenOCD Users
  95. -----------------------
  96. If you would rather be working "with" OpenOCD rather than "on" it, your
  97. operating system or JTAG interface supplier may provide binaries for
  98. you in a convenient-enough package.
  99. Such packages may be more stable than git mainline, where
  100. bleeding-edge development takes place. These "Packagers" produce
  101. binary releases of OpenOCD after the developers produces new "release"
  102. versions of the source code. Previous versions of OpenOCD cannot be
  103. used to diagnose problems with the current release, so users are
  104. encouraged to keep in contact with their distribution package
  105. maintainers or interface vendors to ensure suitable upgrades appear
  106. regularly.
  107. Users of these binary versions of OpenOCD must contact their Packager to
  108. ask for support or newer versions of the binaries; the OpenOCD
  109. developers do not support packages directly.
  110. A Note to OpenOCD Packagers
  111. ---------------------------
  112. You are a PACKAGER of OpenOCD if you:
  113. - Sell dongles and include pre-built binaries;
  114. - Supply tools or IDEs (a development solution integrating OpenOCD);
  115. - Build packages (e.g. RPM or DEB files for a GNU/Linux distribution).
  116. As a PACKAGER, you will experience first reports of most issues.
  117. When you fix those problems for your users, your solution may help
  118. prevent hundreds (if not thousands) of other questions from other users.
  119. If something does not work for you, please work to inform the OpenOCD
  120. developers know how to improve the system or documentation to avoid
  121. future problems, and follow-up to help us ensure the issue will be fully
  122. resolved in our future releases.
  123. That said, the OpenOCD developers would also like you to follow a few
  124. suggestions:
  125. - Send patches, including config files, upstream, participate in the
  126. discussions;
  127. - Enable all the options OpenOCD supports, even those unrelated to your
  128. particular hardware;
  129. - Use "ftdi" interface adapter driver for the FTDI-based devices.
  130. As a PACKAGER, never link against the FTD2XX library, as the resulting
  131. binaries can't be legally distributed, due to the restrictions of the
  132. GPL.
  133. ================
  134. Building OpenOCD
  135. ================
  136. The INSTALL file contains generic instructions for running 'configure'
  137. and compiling the OpenOCD source code. That file is provided by
  138. default for all GNU autotools packages. If you are not familiar with
  139. the GNU autotools, then you should read those instructions first.
  140. The remainder of this document tries to provide some instructions for
  141. those looking for a quick-install.
  142. OpenOCD Dependencies
  143. --------------------
  144. GCC or Clang is currently required to build OpenOCD. The developers
  145. have begun to enforce strict code warnings (-Wall, -Werror, -Wextra,
  146. and more) and use C99-specific features: inline functions, named
  147. initializers, mixing declarations with code, and other tricks. While
  148. it may be possible to use other compilers, they must be somewhat
  149. modern and could require extending support to conditionally remove
  150. GCC-specific extensions.
  151. You'll also need:
  152. - make
  153. - libtool
  154. Additionally, for building from git:
  155. - autoconf >= 2.59
  156. - automake >= 1.9
  157. - texinfo
  158. USB-based adapters depend on libusb-1.0 and some older drivers require
  159. libusb-0.1 or libusb-compat-0.1.
  160. USB-Blaster, ASIX Presto, OpenJTAG and ft2232 interface adapter
  161. drivers need either one of:
  162. - libftdi: http://www.intra2net.com/en/developer/libftdi/index.php
  163. - ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm (proprietary,
  164. GPL-incompatible)
  165. Permissions delegation
  166. ----------------------
  167. Running OpenOCD with root/administrative permissions is strongly
  168. discouraged for security reasons.
  169. For USB devices on GNU/Linux you should use the contrib/openocd.udev
  170. rules file. It probably belongs somewhere in /etc/udev/rules.d, but
  171. consult your operating system documentation to be sure. Do not forget
  172. to add yourself to the "plugdev" group.
  173. For parallel port adapters on GNU/Linux and FreeBSD please change your
  174. "ppdev" (parport* or ppi*) device node permissions accordingly.
  175. For parport adapters on Windows you need to run install_giveio.bat
  176. (it's also possible to use "ioperm" with Cygwin instead) to give
  177. ordinary users permissions for accessing the "LPT" registers directly.
  178. Compiling OpenOCD
  179. -----------------
  180. To build OpenOCD, use the following sequence of commands:
  181. ./bootstrap (when building from the git repository)
  182. ./configure [options]
  183. make
  184. sudo make install
  185. The 'configure' step generates the Makefiles required to build
  186. OpenOCD, usually with one or more options provided to it. The first
  187. 'make' step will build OpenOCD and place the final executable in
  188. './src/'. The final (optional) step, ``make install'', places all of
  189. the files in the required location.
  190. To see the list of all the supported options, run
  191. ./configure --help
  192. Cross-compiling Options
  193. -----------------------
  194. Cross-compiling is supported the standard autotools way, you just need
  195. to specify the cross-compiling target triplet in the --host option,
  196. e.g. for cross-building for Windows 32-bit with MinGW on Debian:
  197. ./configure --host=i686-w64-mingw32 [options]
  198. Parallel Port Dongles
  199. ---------------------
  200. If you want to access the parallel port using the PPDEV interface you
  201. have to specify both --enable-parport AND --enable-parport-ppdev, since the
  202. the later option is an option to the parport driver.
  203. The same is true for the --enable-parport-giveio option, you have to
  204. use both the --enable-parport AND the --enable-parport-giveio option
  205. if you want to use giveio instead of ioperm parallel port access
  206. method.
  207. Using FTDI's FTD2XX
  208. -------------------
  209. The (closed source) FTDICHIP.COM solution is faster than libftdi on
  210. Windows. That is the motivation for supporting it even though its
  211. licensing restricts it to non-redistributable OpenOCD binaries, and it
  212. is not available for all operating systems used with OpenOCD. You may,
  213. however, build such copies for personal use.
  214. The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
  215. TAR.GZ file. You must unpack them ``some where'' convenient. As of this
  216. writing FTDICHIP does not supply means to install these files "in an
  217. appropriate place."
  218. You should use the following ./configure options to make use of
  219. FTD2XX:
  220. --with-ftd2xx-win32-zipdir
  221. Where (CYGWIN/MINGW) the zip file from ftdichip.com
  222. was unpacked <default=search>
  223. --with-ftd2xx-linux-tardir
  224. Where (Linux/Unix) the tar file from ftdichip.com
  225. was unpacked <default=search>
  226. --with-ftd2xx-lib=(static|shared)
  227. Use static or shared ftd2xx libs (default is static)
  228. Remember, this library is binary-only, while OpenOCD is licenced
  229. according to GNU GPLv2 without any exceptions. That means that
  230. _distributing_ copies of OpenOCD built with the FTDI code would
  231. violate the OpenOCD licensing terms.
  232. Note that on Linux there is no good reason to use these FTDI binaries;
  233. they are no faster (on Linux) than libftdi, and cause licensing issues.
  234. ==========================
  235. Obtaining OpenOCD From GIT
  236. ==========================
  237. You can download the current GIT version with a GIT client of your
  238. choice from the main repository:
  239. git://git.code.sf.net/p/openocd/code
  240. You may prefer to use a mirror:
  241. http://repo.or.cz/r/openocd.git
  242. git://repo.or.cz/openocd.git
  243. Using the GIT command line client, you might use the following command
  244. to set up a local copy of the current repository (make sure there is no
  245. directory called "openocd" in the current directory):
  246. git clone git://git.code.sf.net/p/openocd/code openocd
  247. Then you can update that at your convenience using
  248. git pull
  249. There is also a gitweb interface, which you can use either to browse
  250. the repository or to download arbitrary snapshots using HTTP:
  251. http://repo.or.cz/w/openocd.git
  252. Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
  253. each at this writing.