building-openocd-linux.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ***************************************
  2. Building OpenOCD from Sources for Linux
  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-linux`.
  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.
  15. .. note::
  16. Install the following packages one by one, check if installation was successful and then proceed to the next package. Resolve reported problems before moving to the next step.
  17. ::
  18. sudo apt-get install make
  19. sudo apt-get install libtool
  20. sudo apt-get install pkg-config
  21. sudo apt-get install autoconf
  22. sudo apt-get install automake
  23. sudo apt-get install texinfo
  24. sudo apt-get install libusb-1.0
  25. .. note::
  26. * Version of pkg-config should be 0.2.3 or above.
  27. * Version of autoconf should be 2.6.4 or above.
  28. * Version of automake should be 1.9 or above.
  29. * When using USB-Blaster, ASIX Presto, OpenJTAG and FT2232 as adapters, drivers libFTDI and FTD2XX need to be downloaded and installed.
  30. * When using CMSIS-DAP, HIDAPI is needed.
  31. Build OpenOCD
  32. =============
  33. Proceed with configuring and building OpenOCD::
  34. cd ~/esp/openocd-esp32
  35. ./bootstrap
  36. ./configure
  37. make
  38. 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.
  39. .. note::
  40. * Should an error occur, resolve it and try again until the command ``make`` works.
  41. * If there is a submodule problem from OpenOCD, please ``cd`` to the ``openocd-esp32`` directory and input ``git submodule update --init``.
  42. * If the ``./configure`` is successfully run, information of enabled JTAG will be printed under ``OpenOCD configuration summary``.
  43. * 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``.
  44. * For details concerning compiling OpenOCD, please refer to ``openocd-esp32/README``.
  45. Once ``make`` process is successfully completed, the executable of OpenOCD will be saved in ``~/openocd-esp32/bin`` directory.
  46. Next Steps
  47. ==========
  48. To carry on with debugging environment setup, proceed to section :ref:`jtag-debugging-configuring-esp32-target`.