TIP: Hack for changing openocd version

jsam589
Posts: 74
Joined: Sat Aug 17, 2019 9:31 pm

TIP: Hack for changing openocd version

Postby jsam589 » Tue Oct 05, 2021 8:26 pm

I am trying to get JTAG debugging working for gdb from Ubuntu command line per instructions on espressif website. I have IDF 4.0 release and openocd 20190313. I wish to update openocd to a newer version, without changing any other parts of my toolchain. I am not sure which scripts need to be manually updated to change the paths. I have unzipped openocd 20210902 into a folder alongside the original 20190313 version.

My host system is Ubuntu 20.04.3 and my processor is ESP32-WROVER-E (3.3V flash).

This is currently part of my PATH env var:

Code: Select all

$IDF_TOOLS_PATH/tools/openocd-esp32/v0.10.0-esp32-20190313/openocd-esp32/bin
And this is the current OPENOCD_SCRIPTS var

Code: Select all

$IDF_TOOLS_PATH/tools/openocd-esp32/v0.10.0-esp32-20190313/openocd-esp32/share/openocd/scripts
Those were set as part of the normal tools installation so I don't where they actually come from.

I want PATH and OPENOCD_SCRIPTS to both change to the newer version/location:

Code: Select all

$IDF_TOOLS_PATH/tools/openocd-esp32/v0.10.0-esp32-20210902/openocd-esp32/...
Which startup scripts need to be modified to change these? I have looked around but am not sure which ones actually set these vars.
Last edited by jsam589 on Sat Oct 23, 2021 9:16 pm, edited 1 time in total.

jsam589
Posts: 74
Joined: Sat Aug 17, 2019 9:31 pm

Re: Need help updating openocd version paths

Postby jsam589 » Sat Oct 23, 2021 9:15 pm

My solution, which I found myself, was to re-install IDF 4.0 from scratch but before installing tools, hack the tools.json file. It will download the desired openocd version and install it as it installs all the other tools. This went smoothly and works well with Eclipse 2021-06 for JTAG debugging.

Few notes follow:

1. git clone IDF 4.0
cd ~/Develop/Espressif/IDF_40
git clone -b v4.0 --recursive https://github.com/espressif/esp-idf.git
Note: switching to '463a9d8b7f9af8205222b80707f9bdbba7c530e1'. Detached HEAD state.
mkdir tools (this is IDF_40/tools/)
cd esp-idf/tools/
edit idf_tools.py line 1183 and remove arg '--no-site-packages', and save before run install.sh

2. edit tools.json
replace lines 211-213 with the following:
"sha256": "bd7364b8bf4fa03eebbac7f8aba8632029c34946ee67d451c02182aae8bc38e0",
"size": 1802447,
"url": "https://github.com/espressif/openocd-es ... 902.tar.gz"
replace line 220 with the following:
"name": "v0.10.0-esp32-20210902",

3. Install configured tools
cd ~/Develop/Espressif/IDF_40/esp-idf
./install.sh (python reqmts)
For openocd should see: Installing openocd-esp32@v0.10.0-esp32-20210902

4. Verify openocd version after tool install completes.
openocd --version
Open On-Chip Debugger v0.10.0-esp32-20210902 (2021-09-02-09:38)
Licensed under GNU GPL v2

Who is online

Users browsing this forum: No registered users and 437 guests