Skip to content

Commit 02c7c38

Browse files
committed
Merge branch 'bugfix/openocd_ulp_install_instructions' into 'master'
docs: jtag-debugging: update for IDF Tools installation method Closes IDF-824 See merge request espressif/esp-idf!5803
2 parents 636c6a9 + 7237e6f commit 02c7c38

21 files changed

+94
-359
lines changed

docs/en/api-guides/jtag-debugging/building-openocd-linux.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Building OpenOCD from Sources for Linux
33
***************************************
44
:link_to_translation:`zh_CN:[中文]`
55

6-
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 :doc:`setup-openocd-linux`.
6+
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`.
77

88

99
.. highlight:: bash

docs/en/api-guides/jtag-debugging/building-openocd-macos.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Building OpenOCD from Sources for MacOS
33
***************************************
44
:link_to_translation:`zh_CN:[中文]`
55

6-
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 :doc:`setup-openocd-macos`.
6+
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`.
77

88
.. highlight:: bash
99

docs/en/api-guides/jtag-debugging/building-openocd-windows.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Building OpenOCD from Sources for Windows
33
*****************************************
44
:link_to_translation:`zh_CN:[中文]`
55

6-
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 :doc:`setup-openocd-windows`.
6+
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`.
77

88
.. highlight:: bash
99

docs/en/api-guides/jtag-debugging/configure-wrover.rst

+2-8
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,14 @@ Manually unloading the driver
121121

122122
sudo kextunload -b com.apple.driver.AppleUSBFTDI
123123

124-
4. Run OpenOCD (paths are given for downloadable OpenOCD archive)::
124+
4. Run OpenOCD::
125125

126-
bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
127-
128-
Or, if OpenOCD was built from source::
129-
130-
src/openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
126+
bin/openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
131127

132128
5. In another terminal window, load FTDI serial port driver again::
133129

134130
sudo kextload -b com.FTDI.driver.FTDIUSBSerialDriver
135131

136-
.. include:: ./windows-openocd-note.rst
137-
138132
.. note::
139133

140134
If you need to restart OpenOCD, there is no need to unload FTDI driver again — just stop OpenOCD and start it again. The driver only needs to be unloaded if WROVER KIT was reconnected or power was toggled.

docs/en/api-guides/jtag-debugging/index.rst

+37-46
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GDB. The document is structured as follows:
1212
:ref:`jtag-debugging-selecting-jtag-adapter`
1313
What are the criteria and options to select JTAG adapter hardware.
1414
:ref:`jtag-debugging-setup-openocd`
15-
Procedure to install OpenOCD using prebuilt software packages for :doc:`Windows <setup-openocd-windows>`, :doc:`Linux <setup-openocd-linux>` and :doc:`MacOS <setup-openocd-macos>` operating systems.
15+
Procedure to install OpenOCD and verify that it is installed.
1616
:ref:`jtag-debugging-configuring-esp32-target`
1717
Configuration of OpenOCD software and set up JTAG adapter hardware that will make together a debugging target.
1818
:ref:`jtag-debugging-launching-debugger`
@@ -84,45 +84,28 @@ The minimal signalling to get a working JTAG connection are TDI, TDO, TCK, TMS a
8484
Setup of OpenOCD
8585
----------------
8686

87-
This step covers installation of OpenOCD binaries. If you like to build OpenOCS from sources then refer to section :ref:`jtag-debugging-building-openocd`. All OpenOCD files will be placed in ``~/esp/openocd-esp32`` directory. You may choose any other directory, but need to adjust respective paths used in examples.
88-
89-
.. toctree::
90-
:hidden:
91-
92-
Windows <setup-openocd-windows>
93-
Linux <setup-openocd-linux>
94-
MacOS <setup-openocd-macos>
95-
96-
Pick up your OS below and follow provided instructions to setup OpenOCD.
87+
.. highlight:: bash
9788

98-
+-------------------+-------------------+-------------------+
99-
| |windows-logo| | |linux-logo| | |macos-logo| |
100-
+-------------------+-------------------+-------------------+
101-
| `Windows`_ | `Linux`_ | `Mac OS`_ |
102-
+-------------------+-------------------+-------------------+
89+
If you have already set up ESP-IDF with CMake build system according to the :doc:`Getting Started Guide <../../get-started/index>`, then OpenOCD is already installed. After :ref:`setting up the environment <get-started-set-up-env>` in your terminal, you should be able to run OpenOCD. Check this by executing the following command::
10390

104-
.. |windows-logo| image:: ../../../_static/windows-logo.png
105-
:target: ../jtag-debugging/setup-openocd-windows.html
91+
openocd --version
10692

107-
.. |linux-logo| image:: ../../../_static/linux-logo.png
108-
:target: ../jtag-debugging/setup-openocd-linux.html
93+
.. highlight:: none
10994

110-
.. |macos-logo| image:: ../../../_static/macos-logo.png
111-
:target: ../jtag-debugging/setup-openocd-macos.html
95+
The output should be as follows (although the version may be more recent than listed here)::
11296

113-
.. _Windows: ../jtag-debugging/setup-openocd-windows.html
114-
.. _Linux: ../jtag-debugging/setup-openocd-linux.html
115-
.. _Mac OS: ../jtag-debugging/setup-openocd-macos.html
97+
Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
98+
Licensed under GNU GPL v2
99+
For bug reports, read
100+
http://openocd.org/doc/doxygen/bugs.html
116101

117-
After installation is complete, get familiar with two key directories inside ``openocd-esp32`` installation folder:
102+
You may also verify that OpenOCD knows where its configuration scripts are located by printing the value of ``OPENOCD_SCRIPTS`` environment variable, by typing ``echo $OPENOCD_SCRIPTS`` (for Linux and macOS) or ``echo %OPENOCD_SCRIPTS%`` (for Windows). If a valid path is printed, then OpenOCD is set up correctly.
118103

119-
* ``bin`` containing OpenOCD executable
120-
* ``share\openocd\scripts`` containing configuration files invoked together with OpenOCD as command line parameters
104+
If any of these steps do not work, please go back to the :ref:`setting up the tools <get-started-set-up-tools>` section of the Getting Started Guide.
121105

122106
.. note::
123107

124-
Directory names and structure above are specific to binary distribution of OpenOCD. They are used in examples of invoking OpenOCD throughout this guide. Directories for OpenOCD build from sources are different, so the way to invoke OpenOCD. For details see :ref:`jtag-debugging-building-openocd`.
125-
108+
It is also possible to build OpenOCD from source. Please refer to :ref:`jtag-debugging-building-openocd` section for details.
126109

127110
.. _jtag-debugging-configuring-esp32-target:
128111

@@ -157,23 +140,20 @@ Once target is configured and connected to computer, you are ready to launch Ope
157140

158141
.. highlight:: bash
159142

160-
Open terminal, go to directory where OpenOCD is installed and start it up::
143+
Open a terminal and set it up for using the ESP-IDF as described in the :ref:`setting up the environment <get-started-set-up-env>` section of the Getting Started Guide. Then run OpenOCD (this command works on Windows, Linux, and macOS)::
161144

162-
cd ~/esp/openocd-esp32
163-
bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
145+
openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
164146

165147
.. note::
166148

167-
The files provided after ``-f`` above, are specific for ESP-WROVER-KIT with :ref:`esp-modules-and-boards-esp32-wroom-32` module. You may need to provide different files depending on used hardware, For guidance see :ref:`jtag-debugging-tip-openocd-configure-target`.
168-
169-
.. include:: ./windows-openocd-note.rst
149+
The files provided after ``-f`` above are specific for ESP-WROVER-KIT with :ref:`esp-modules-and-boards-esp32-wroom-32` module. You may need to provide different files depending on used hardware. For guidance see :ref:`jtag-debugging-tip-openocd-configure-target`.
170150

171151
.. highlight:: none
172152

173153
You should now see similar output (this log is for ESP-WROVER-KIT)::
174154

175-
user-name@computer-name:~/esp/openocd-esp32$ bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
176-
Open On-Chip Debugger 0.10.0-dev-ged7b1a9 (2017-07-10-07:16)
155+
user-name@computer-name:~/esp/esp-idf$ openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
156+
Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
177157
Licensed under GNU GPL v2
178158
For bug reports, read
179159
http://openocd.org/doc/doxygen/bugs.html
@@ -201,10 +181,7 @@ Build and upload your application to ESP32 as usual, see :ref:`get-started-build
201181

202182
Another option is to write application image to flash using OpenOCD via JTAG with commands like this::
203183

204-
cd ~/esp/openocd-esp32
205-
bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 filename.bin 0x10000 verify exit"
206-
207-
.. include:: ./windows-openocd-note.rst
184+
openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "program_esp32 filename.bin 0x10000 verify exit"
208185

209186
OpenOCD flashing command ``program_esp32`` has the following format:
210187

@@ -268,13 +245,27 @@ Please refer to separate documents listed below, that describe build process.
268245
Linux <building-openocd-linux>
269246
MacOS <building-openocd-macos>
270247

271-
.. note::
248+
The examples of invoking OpenOCD in this document assume using pre-built binary distribution described in section :ref:`jtag-debugging-setup-openocd`.
249+
250+
.. highlight:: bash
251+
252+
To use binaries build locally from sources, change the path to OpenOCD executable to ``src/openocd`` and set the ``OPENOCD_SCRIPTS`` environment variable so that OpenOCD can find the configuration files. For Linux and macOS::
253+
254+
cd ~/esp/openocd-esp32
255+
export OPENOCD_SCRIPTS=$PWD/tcl
256+
257+
For Windows::
258+
259+
cd %USERPROFILE%\esp\openocd-esp32
260+
set "OPENOCD_SCRIPTS=%CD%\tcl"
261+
262+
Example of invoking OpenOCD build locally from sources, for Linux and macOS::
272263

273-
Examples of invoking OpenOCD in this document assume using pre-built binary distribution described in section :ref:`jtag-debugging-setup-openocd`. To use binaries build locally from sources, change the path to OpenOCD executable to ``src/openocd`` and the path to configuration files to ``-s tcl``.
264+
src/openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
274265

275-
Example of invoking OpenOCD build locally from sources::
266+
and Windows::
276267

277-
src/openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
268+
src\openocd -f interface\ftdi\esp32_devkitj_v1.cfg -f board\esp-wroom-32.cfg
278269

279270

280271
.. _jtag-debugging-tips-and-quirks:

docs/en/api-guides/jtag-debugging/setup-openocd-linux.rst

-34
This file was deleted.

docs/en/api-guides/jtag-debugging/setup-openocd-macos.rst

-39
This file was deleted.

docs/en/api-guides/jtag-debugging/setup-openocd-windows.rst

-40
This file was deleted.

docs/en/api-guides/jtag-debugging/tips-and-quirks.rst

+3-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Offset should be in hex format. To reset to the default behaviour you can specif
3636

3737
Since GDB requests memory map from OpenOCD only once when connecting to it, this command should be specified in one of the TCL configuration files, or passed to OpenOCD via its command line. In the latter case command line should look like below:
3838

39-
``bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "init; halt; esp32 appimage_offset 0x210000"``
39+
``openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "init; halt; esp32 appimage_offset 0x210000"``
4040

4141
Another option is to execute that command via OpenOCD telnet session and then connect GDB, but it seems to be less handy.
4242

@@ -259,17 +259,13 @@ In case you encounter a problem with OpenOCD or GDB programs itself and do not f
259259

260260
::
261261

262-
bin/openocd -l openocd_log.txt -d 3 -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
262+
openocd -l openocd_log.txt -d 3 -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
263263

264264
Logging to a file this way will prevent information displayed on the terminal. This may be a good thing taken amount of information provided, when increased debug level ``-d 3`` is set. If you still like to see the log on the screen, then use another command instead:
265265

266266
::
267267

268-
bin/openocd -d 3 -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg 2>&1 | tee openocd.log
269-
270-
.. note::
271-
272-
See :ref:`jtag-debugging-building-openocd` for slightly different command format, when running OpenOCD built from sources.
268+
openocd -d 3 -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg 2>&1 | tee openocd.log
273269

274270
Debugger:
275271

docs/en/api-guides/jtag-debugging/windows-openocd-note.rst

-3
This file was deleted.

docs/zh_CN/api-guides/jtag-debugging/building-openocd-linux.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Linux 环境下从源码编译 OpenOCD
33
******************************
44
:link_to_translation:`en:[English]`
55

6-
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :doc:`setup-openocd-linux` 章节查阅。
6+
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :ref:`jtag-debugging-setup-openocd` 章节查阅。
77

88

99
.. highlight:: bash

docs/zh_CN/api-guides/jtag-debugging/building-openocd-macos.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ MacOS 环境下从源码编译 OpenOCD
33
******************************
44
:link_to_translation:`en:[English]`
55

6-
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :doc:`setup-openocd-macos` 章节查阅。
6+
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :ref:`jtag-debugging-setup-openocd` 章节查阅。
77

88
.. highlight:: bash
99

docs/zh_CN/api-guides/jtag-debugging/building-openocd-windows.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Windows 环境下从源码编译 OpenOCD
33
********************************
44
:link_to_translation:`en:[English]`
55

6-
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :doc:`setup-openocd-windows` 章节查阅。
6+
除了从 `Espressif 官方 <https://github.com/espressif/openocd-esp32/releases>`_ 直接下载 OpenOCD 可执行文件,你还可以选择从源码编译得到 OpenOCD。如果想要快速设置 OpenOCD 而不是自行编译,请备份好当前文件,前往 :ref:`jtag-debugging-setup-openocd` 章节查阅。
77

88

99
.. highlight:: bash

docs/zh_CN/api-guides/jtag-debugging/configure-wrover.rst

+2-8
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,14 @@ MacOS
121121

122122
sudo kextunload -b com.apple.driver.AppleUSBFTDI
123123

124-
4. 运行 OpenOCD(以下路径为 Github 上可供下载的预编译后的 OpenOCD)::
124+
4. 运行 OpenOCD::
125125

126-
bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
127-
128-
如果 OpenOCD 是从源码编译得到的,那么路径需要做相应修改::
129-
130-
src/openocd -s tcl -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
126+
openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
131127

132128
5. 在另一个终端窗口,再一次加载 FTDI 串口驱动::
133129

134130
sudo kextload -b com.FTDI.driver.FTDIUSBSerialDriver
135131

136-
.. include:: ./windows-openocd-note.rst
137-
138132
.. note::
139133

140134
如果你需要重启 OpenOCD,则无需再次卸载 FTDI 驱动程序,只需停止 OpenOCD 并再次启动它。只有在重新连接 ESP-WROVER-KIT 或者切换了电源的情况下才需要再次卸载驱动。

0 commit comments

Comments
 (0)