2017-06-11 19:12:30 +00:00
***** ***** ***** ***** ***** ***** ***** *** *
Building OpenOCD from Sources for MacOS
***** ***** ***** ***** ***** ***** ***** *** *
2019-01-29 09:22:29 +00:00
:link_to_translation:`zh_CN:[中文]`
2017-06-11 19:12:30 +00:00
2019-08-16 07:34:49 +00:00
The following instructions are alternative to downloading binary OpenOCD from `Espressif GitHub <https://github.com/espressif/openocd-esp32/releases> `_ . To quickly setup the binary OpenOCD, instead of compiling it yourself, backup and proceed to section :ref: `jtag-debugging-setup-openocd` .
2017-06-11 19:12:30 +00:00
2017-07-26 08:09:36 +00:00
.. highlight :: bash
Download Sources of OpenOCD
===========================
2019-12-09 03:01:09 +00:00
The sources for the {IDF_TARGET_NAME}-enabled variant of OpenOCD are available from Espressif GitHub under https://github.com/espressif/openocd-esp32. To download the sources, use the following commands::
2017-07-26 08:09:36 +00:00
cd ~/esp
2018-05-11 18:08:55 +00:00
git clone --recursive https://github.com/espressif/openocd-esp32.git
2017-07-26 08:09:36 +00:00
The clone of sources should be now saved in `` ~/esp/openocd-esp32 `` directory.
Install Dependencies
====================
Install packages that are required to compile OpenOCD using Homebrew::
2019-01-29 09:22:29 +00:00
brew install automake libtool libusb wget gcc@4.9 pkg-config
2017-06-11 19:12:30 +00:00
Build OpenOCD
=============
2017-07-26 08:09:36 +00:00
Proceed with configuring and building OpenOCD::
cd ~/esp/openocd-esp32
./bootstrap
./configure
make
Optionally you can add `` sudo make install `` step at the end. Skip it, if you have an existing OpenOCD (from e.g. another development platform), as it may get overwritten.
.. note ::
2019-12-09 03:01:09 +00:00
* Should an error occur, resolve it and try again until the command `` make `` works.
2017-07-26 08:09:36 +00:00
* If there is a submodule problem from OpenOCD, please `` cd `` to the `` openocd-esp32 `` directory and input `` git submodule update --init `` .
2019-12-09 03:01:09 +00:00
* If the `` ./configure `` is successfully run, information of enabled JTAG will be printed under `` OpenOCD configuration summary `` .
2017-07-26 08:09:36 +00:00
* If the information of your device is not shown in the log, use `` ./configure `` to enable it as described in `` ../openocd-esp32/doc/INSTALL.txt `` .
* For details concerning compiling OpenOCD, please refer to `` openocd-esp32/README.OSX `` .
2017-06-11 19:12:30 +00:00
2017-07-26 08:09:36 +00:00
Once `` make `` process is successfully completed, the executable of OpenOCD will be saved in `` ~/esp/openocd-esp32/src/openocd `` directory.
2017-06-11 19:12:30 +00:00
Next Steps
==========
2019-12-09 03:01:09 +00:00
To carry on with debugging environment setup, proceed to section :ref: `jtag-debugging-configuring-target` .
2017-06-11 19:12:30 +00:00