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 including:
  5. - (X)SVF playback to facilitate automated boundary scan and FPGA/CPLD
  6. programming;
  7. - debug target support (e.g. ARM, MIPS): single-stepping,
  8. breakpoints/watchpoints, gprof profiling, etc;
  9. - flash chip drivers (e.g. CFI, NAND, internal flash);
  10. - embedded TCL interpreter 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 -c "transport select jtag" \
  32. -f target/ti_calypso.cfg
  33. openocd -f interface/stlink-v2-1.cfg -c "transport select hla_swd" \
  34. -f target/stm32l0.cfg
  35. After OpenOCD startup, connect GDB with
  36. (gdb) target extended-remote localhost:3333
  37. =====================
  38. OpenOCD Documentation
  39. =====================
  40. In addition to the in-tree documentation, the latest manuals may be
  41. viewed online at the following URLs:
  42. OpenOCD User's Guide:
  44. OpenOCD Developer's Manual:
  46. These reflect the latest development versions, so the following section
  47. introduces how to build the complete documentation from the package.
  48. For more information, refer to these documents or contact the developers
  49. by subscribing to the OpenOCD developer mailing list:
  51. Building the OpenOCD Documentation
  52. ----------------------------------
  53. By default the OpenOCD build process prepares documentation in the
  54. "Info format" and installs it the standard way, so that "info openocd"
  55. can access it.
  56. Additionally, the OpenOCD User's Guide can be produced in the
  57. following different formats:
  58. # If PDFVIEWER is set, this creates and views the PDF User Guide.
  59. make pdf && ${PDFVIEWER} doc/openocd.pdf
  60. # If HTMLVIEWER is set, this creates and views the HTML User Guide.
  61. make html && ${HTMLVIEWER} doc/openocd.html/index.html
  62. The OpenOCD Developer Manual contains information about the internal
  63. architecture and other details about the code:
  64. # NB! make sure doxygen is installed, type doxygen --version
  65. make doxygen && ${HTMLVIEWER} doxygen/index.html
  66. ==================
  67. Supported hardware
  68. ==================
  69. JTAG adapters
  70. -------------
  71. AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432,
  72. BCM2835, Bus Blaster, Buspirate, Chameleon, CMSIS-DAP, Cortino, DENX,
  73. Digilent JTAG-SMT2, DLC 5, DLP-USB1232H, embedded projects, eStick,
  74. FlashLINK, FlossJTAG, Flyswatter, Flyswatter2, Gateworks, Hoegl, ICDI,
  75. ICEBear, J-Link, JTAG VPI, JTAGkey, JTAGkey2, JTAG-lock-pick, KT-Link,
  76. Lisa/L, LPC1768-Stick, MiniModule, NGX, NXHX, OOCDLink, Opendous,
  77. OpenJTAG, Openmoko, OpenRD, OSBDM, Presto, Redbee, RLink, SheevaPlug
  78. devkit, Stellaris evkits, ST-LINK (SWO tracing supported),
  79. STM32-PerformanceStick, STR9-comStick, sysfsgpio, TUMPA, Turtelizer,
  80. ULINK, USB-A9260, USB-Blaster, USB-JTAG, USBprog, VPACLink, VSLLink,
  81. Wiggler, XDS100v2, Xverve.
  82. Debug targets
  83. -------------
  84. ARM11, ARM7, ARM9, AVR32, Cortex-A, Cortex-R, Cortex-M, LS102x-SAP,
  85. Feroceon/Dragonite, DSP563xx, DSP5680xx, FA526, MIPS EJTAG, NDS32,
  86. XScale, Intel Quark.
  87. Flash drivers
  88. -------------
  89. ADUC702x, AT91SAM, AVR, CFI, DSP5680xx, EFM32, EM357, FM3, FM4, Kinetis,
  90. LPC8xx/LPC1xxx/LPC2xxx/LPC541xx, LPC2900, LPCSPIFI, Marvell QSPI,
  91. Milandr, NIIET, NuMicro, PIC32mx, PSoC4, SiM3x, Stellaris, STM32, STMSMI,
  92. STR7x, STR9x, nRF51; NAND controllers of AT91SAM9, LPC3180, LPC32xx,
  93. i.MX31, MXC, NUC910, Orion/Kirkwood, S3C24xx, S3C6400, XMC1xxx, XMC4xxx.
  94. ==================
  95. Installing OpenOCD
  96. ==================
  97. A Note to OpenOCD Users
  98. -----------------------
  99. If you would rather be working "with" OpenOCD rather than "on" it, your
  100. operating system or JTAG interface supplier may provide binaries for
  101. you in a convenient-enough package.
  102. Such packages may be more stable than git mainline, where
  103. bleeding-edge development takes place. These "Packagers" produce
  104. binary releases of OpenOCD after the developers produces new "release"
  105. versions of the source code. Previous versions of OpenOCD cannot be
  106. used to diagnose problems with the current release, so users are
  107. encouraged to keep in contact with their distribution package
  108. maintainers or interface vendors to ensure suitable upgrades appear
  109. regularly.
  110. Users of these binary versions of OpenOCD must contact their Packager to
  111. ask for support or newer versions of the binaries; the OpenOCD
  112. developers do not support packages directly.
  113. A Note to OpenOCD Packagers
  114. ---------------------------
  115. You are a PACKAGER of OpenOCD if you:
  116. - Sell dongles and include pre-built binaries;
  117. - Supply tools or IDEs (a development solution integrating OpenOCD);
  118. - Build packages (e.g. RPM or DEB files for a GNU/Linux distribution).
  119. As a PACKAGER, you will experience first reports of most issues.
  120. When you fix those problems for your users, your solution may help
  121. prevent hundreds (if not thousands) of other questions from other users.
  122. If something does not work for you, please work to inform the OpenOCD
  123. developers know how to improve the system or documentation to avoid
  124. future problems, and follow-up to help us ensure the issue will be fully
  125. resolved in our future releases.
  126. That said, the OpenOCD developers would also like you to follow a few
  127. suggestions:
  128. - Send patches, including config files, upstream, participate in the
  129. discussions;
  130. - Enable all the options OpenOCD supports, even those unrelated to your
  131. particular hardware;
  132. - Use "ftdi" interface adapter driver for the FTDI-based devices.
  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. - pkg-config >= 0.23 (or compatible)
  155. Additionally, for building from git:
  156. - autoconf >= 2.64
  157. - automake >= 1.14
  158. - texinfo
  159. USB-based adapters depend on libusb-1.0 and some older drivers require
  160. libusb-0.1 or libusb-compat-0.1. A compatible implementation, such as
  161. FreeBSD's, additionally needs the corresponding .pc files.
  162. USB-Blaster, ASIX Presto and OpenJTAG interface adapter
  163. drivers need:
  164. - libftdi:
  165. CMSIS-DAP support needs HIDAPI library.
  166. Permissions delegation
  167. ----------------------
  168. Running OpenOCD with root/administrative permissions is strongly
  169. discouraged for security reasons.
  170. For USB devices on GNU/Linux you should use the contrib/60-openocd.rules
  171. file. It probably belongs somewhere in /etc/udev/rules.d, but
  172. consult your operating system documentation to be sure. Do not forget
  173. to add yourself to the "plugdev" group.
  174. For parallel port adapters on GNU/Linux and FreeBSD please change your
  175. "ppdev" (parport* or ppi*) device node permissions accordingly.
  176. For parport adapters on Windows you need to run install_giveio.bat
  177. (it's also possible to use "ioperm" with Cygwin instead) to give
  178. ordinary users permissions for accessing the "LPT" registers directly.
  179. Compiling OpenOCD
  180. -----------------
  181. To build OpenOCD, use the following sequence of commands:
  182. ./bootstrap (when building from the git repository)
  183. ./configure [options]
  184. make
  185. sudo make install
  186. The 'configure' step generates the Makefiles required to build
  187. OpenOCD, usually with one or more options provided to it. The first
  188. 'make' step will build OpenOCD and place the final executable in
  189. './src/'. The final (optional) step, ``make install'', places all of
  190. the files in the required location.
  191. To see the list of all the supported options, run
  192. ./configure --help
  193. Cross-compiling Options
  194. -----------------------
  195. Cross-compiling is supported the standard autotools way, you just need
  196. to specify the cross-compiling target triplet in the --host option,
  197. e.g. for cross-building for Windows 32-bit with MinGW on Debian:
  198. ./configure --host=i686-w64-mingw32 [options]
  199. To make pkg-config work nicely for cross-compiling, you might need an
  200. additional wrapper script as described at
  202. This is needed to tell pkg-config where to look for the target
  203. libraries that OpenOCD depends on. Alternatively, you can specify
  204. *_CFLAGS and *_LIBS environment variables directly, see "./configure
  205. --help" for the details.
  206. Parallel Port Dongles
  207. ---------------------
  208. If you want to access the parallel port using the PPDEV interface you
  209. have to specify both --enable-parport AND --enable-parport-ppdev, since the
  210. the later option is an option to the parport driver.
  211. The same is true for the --enable-parport-giveio option, you have to
  212. use both the --enable-parport AND the --enable-parport-giveio option
  213. if you want to use giveio instead of ioperm parallel port access
  214. method.
  215. ==========================
  216. Obtaining OpenOCD From GIT
  217. ==========================
  218. You can download the current GIT version with a GIT client of your
  219. choice from the main repository:
  220. git://
  221. You may prefer to use a mirror:
  223. git://
  224. Using the GIT command line client, you might use the following command
  225. to set up a local copy of the current repository (make sure there is no
  226. directory called "openocd" in the current directory):
  227. git clone git:// openocd
  228. Then you can update that at your convenience using
  229. git pull
  230. There is also a gitweb interface, which you can use either to browse
  231. the repository or to download arbitrary snapshots using HTTP:
  233. Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
  234. each at this writing.