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