building-openocd-macos.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ***************************************
  2. Building OpenOCD from Sources for MacOS
  3. ***************************************
  4. The following instructions are alternative to downloading binary OpenOCD from Espressif website. To quickly setup the binary OpenOCD, instead of compiling it yourself, backup and proceed to section :doc:`setup-openocd-macos`.
  5. .. highlight:: bash
  6. Download Sources of OpenOCD
  7. ===========================
  8. The sources for the ESP32-enabled variant of OpenOCD are available from Espressif GitHub under https://github.com/espressif/openocd-esp32. To download the sources, use the following commands::
  9. cd ~/esp
  10. git clone –recursive https://github.com/espressif/openocd-esp32.git
  11. The clone of sources should be now saved in ``~/esp/openocd-esp32`` directory.
  12. Install Dependencies
  13. ====================
  14. Install packages that are required to compile OpenOCD using Homebrew::
  15. brew install automake libtool libusb wget gcc@4.9
  16. Build OpenOCD
  17. =============
  18. Proceed with configuring and building OpenOCD::
  19. cd ~/esp/openocd-esp32
  20. ./bootstrap
  21. ./configure
  22. make
  23. 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.
  24. .. note::
  25. * Should an error occur, resolve it and try again until the command ``make`` works.
  26. * If there is a submodule problem from OpenOCD, please ``cd`` to the ``openocd-esp32`` directory and input ``git submodule update --init``.
  27. * If the ``./configure`` is successfully run, information of enabled JTAG will be printed under ``OpenOCD configuration summary``.
  28. * 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``.
  29. * For details concerning compiling OpenOCD, please refer to ``openocd-esp32/README.OSX``.
  30. Once ``make`` process is successfully completed, the executable of OpenOCD will be saved in ``~/esp/openocd-esp32/src/openocd`` directory.
  31. Next Steps
  32. ==========
  33. To carry on with debugging environment setup, proceed to section :ref:`jtag-debugging-configuring-esp32-target`.