Error installing openocd during MDF setup step 2: Setup Toolchain

MattKefford
Posts: 4
Joined: Mon Jun 15, 2020 7:56 pm

Error installing openocd during MDF setup step 2: Setup Toolchain

Postby MattKefford » Mon Jun 15, 2020 8:37 pm

Following quick start guide at https://github.com/espressif/esp-mdf.

I have used ESP-IDF in the past so I thought I would be ok setting up MDF but I am hitting an error while setting up the toolchain.
I installed pip, pyserial, cmake, ninja as described on the page https://docs.espressif.com/projects/esp ... setup.html
and then followed the link to the next page which is https://docs.espressif.com/projects/esp ... et-esp-idf

I already had ESP-IDF cloned into esp/esp-idf so I did a git fetch and checked out branch release/v3.2 as I saw on the forum that MDF only works with version 3.2.
The first error occurs when I run ./install.sh and it can't find the script:

Keffords-Mac:esp Kefford$ cd esp-idf/
Keffords-Mac:esp-idf Kefford$ git describe
v3.2.2-436-g8e74a471e
Keffords-Mac:esp-idf Kefford$ ./install.sh
-bash: ./install.sh: No such file or directory
Keffords-Mac:esp-idf Kefford$ pwd
/Users/Kefford/esp/esp-idf


I noticed in the quick start instructions that it said to try the following:
cd ~/esp/esp-mdf/esp-idf
./install.sh

So I am assuming that although the instructions say to install ESP-IDF separately, they are also installed as part of MDF?

So I went to this path and tried again and got this:
Keffords-Mac:esp-idf Kefford$ pwd
/Users/Kefford/esp/esp-idf
Keffords-Mac:esp-idf Kefford$ cd ..
Keffords-Mac:esp Kefford$ ls
esp-idf esp-mdf hello_world
Keffords-Mac:esp Kefford$ cd esp-mdf/esp-idf/
Keffords-Mac:esp-idf Kefford$ ls
CMakeLists.txt add_path.sh install.bat
CONTRIBUTING.rst components install.sh
Kconfig docs make
LICENSE examples requirements.txt
README.md export.bat tools
SUPPORT_POLICY.md export.sh
Keffords-Mac:esp-idf Kefford$ git describe
v3.3.2-256-g332e243f1
Keffords-Mac:esp-idf Kefford$ ./install.sh
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@1.22.0-80-g6c4433a-5.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Installing openocd-esp32@v0.10.0-esp32-20190313
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
Traceback (most recent call last):
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1358, in <module>
main(sys.argv[1:])
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1354, in main
action_func(args)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1139, in action_install
tool_obj.download(tool_version)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 568, in download
urlretrieve(url, local_temp_path, report_progress if not global_non_interactive else None)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1212, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 566, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)


I tried it on v3.3 instead:

Switched to branch 'release/v3.3'
Your branch is up to date with 'origin/release/v3.3'.
Keffords-Mac:esp-idf Kefford$ pwd
/Users/Kefford/esp/esp-mdf/esp-idf
Keffords-Mac:esp-idf Kefford$ ./install.sh
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@1.22.0-80-g6c4433a-5.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Installing openocd-esp32@v0.10.0-esp32-20190313
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
Traceback (most recent call last):
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1358, in <module>
main(sys.argv[1:])
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1354, in main
action_func(args)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1139, in action_install
tool_obj.download(tool_version)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 568, in download
urlretrieve(url, local_temp_path, report_progress if not global_non_interactive else None)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1212, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 566, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)


It always seems to fail on the openocd part no matter which ESP-IDF folder I'm in (why do I need two?) and which version I try.

Any help would be appreciated, I have some dev kits arriving any day now so would like to get the tools set up before they arrive :)

MattKefford
Posts: 4
Joined: Mon Jun 15, 2020 7:56 pm

Re: Error installing openocd during MDF setup step 2: Setup Toolchain

Postby MattKefford » Wed Jun 17, 2020 9:07 am

I realised I pasted something wrong there, but it seems I can't edit the post so I will clarify here :)

At the stage where I realised MDF had also installed IDF in esp/esp-mdf/esp-idf, I switched to this directory, checked out v3.2 and tried to execute the install script which went like this:

Keffords-Mac:esp-idf Kefford$ git fetch
remote: Enumerating objects: 1177, done.
remote: Counting objects: 100% (1177/1177), done.
remote: Compressing objects: 100% (276/276), done.
remote: Total 1182 (delta 899), reused 1176 (delta 898), pack-reused 5
Receiving objects: 100% (1182/1182), 169.11 KiB | 1.45 MiB/s, done.
Resolving deltas: 100% (899/899), completed with 156 local objects.
From https://github.com/espressif/esp-idf
4c81978a3..e7ac221b4 release/v4.0 -> origin/release/v4.0
Keffords-Mac:esp-idf Kefford$ git checkout release/v3.2
warning: unable to rmdir 'components/unity/unity': Directory not empty
warning: unable to rmdir 'examples/build_system/cmake/import_lib/main/lib/tinyxml2': Directory not empty
M components/asio/asio
M components/coap/libcoap
M components/esptool_py/esptool
M components/expat/expat
M components/lwip/lwip
M components/mbedtls/mbedtls
M components/mqtt/esp-mqtt
Switched to branch 'release/v3.2'
Your branch is up to date with 'origin/release/v3.2'.
Keffords-Mac:esp-idf Kefford$ pwd
/Users/Kefford/esp/esp-mdf/esp-idf
Keffords-Mac:esp-idf Kefford$ ./install.sh
-bash: ./install.sh: No such file or directory
Keffords-Mac:esp-idf Kefford$


Previously I pasted the wrong log relating to a different version checkout.

I'm not sure why the instructions say to run the shell script, as when checking out version 3.2 it isn't even there in the folder?
But then I have seen on the forum that version 4 IDF is not compatible with MDF.
So I tried it with v4.0 anyway, why not when it's not working anyway and at least the script is present in v4:

Keffords-Mac:esp-idf Kefford$ git checkout release/v4.0
Checking out files: 100% (5179/5179), done.
M components/asio/asio
M components/bt/controller/lib
M components/bt/host/nimble/nimble
M components/coap/libcoap
M components/esptool_py/esptool
M components/expat/expat
M components/lwip/lwip
M components/mqtt/esp-mqtt
Branch 'release/v4.0' set up to track remote branch 'release/v4.0' from 'origin'.
Switched to a new branch 'release/v4.0'
Keffords-Mac:esp-idf Kefford$ pwd
/Users/Kefford/esp/esp-mdf/esp-idf
Keffords-Mac:esp-idf Kefford$ ./install.sh
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@esp-2019r2-8.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Installing openocd-esp32@v0.10.0-esp32-20190313
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
WARNING: Download failure [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)
WARNING: Failed to download https://github.com/espressif/openocd-es ... 313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
WARNING: Download failure [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)
WARNING: Failed to download https://github.com/espressif/openocd-es ... 313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
WARNING: Download failure [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)
WARNING: Failed to download https://github.com/espressif/openocd-es ... 313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
ERROR: Failed to download, and retry count has expired
Traceback (most recent call last):
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1387, in <module>
main(sys.argv[1:])
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1383, in main
action_func(args)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 1167, in action_install
tool_obj.download(tool_version)
File "/Users/Kefford/esp/esp-mdf/esp-idf/tools/idf_tools.py", line 584, in download
raise DownloadError()
__main__.DownloadError
Keffords-Mac:esp-idf Kefford$


I did wonder if it was due to my Python version installed, but even if I change that I can't use v3.2 because the install script disappears as soon as I checkout release/v3.2.

Also could you please clarify which location of IDF I need to be controlling the version for:
esp/esp-idf
esp/esp-mdf/esp-idf

MattKefford
Posts: 4
Joined: Mon Jun 15, 2020 7:56 pm

Re: Error installing openocd during MDF setup step 2: Setup Toolchain

Postby MattKefford » Wed Jun 17, 2020 2:54 pm

OK finally I have solved this :)

Thanks to this comment on the github issues tab - https://github.com/espressif/esp-idf/is ... -573750292

I had to clone v4.0.1 then explicitly use python3 to install the tools then I could run install.sh which would now succeed and then continue to install the python env and pkgs:

Keffords-Mac:esp-idf Kefford$ python3.7 ~/esp/esp-idf/tools/idf_tools.py install
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@esp-2019r2-8.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Installing openocd-esp32@v0.10.0-esp32-20190313
Downloading openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz.tmp
Done
Extracting /Users/Kefford/.espressif/dist/openocd-esp32-macos-0.10.0-esp32-20190313.tar.gz to /Users/Kefford/.espressif/tools/openocd-esp32/v0.10.0-esp32-20190313
Keffords-Mac:esp-idf Kefford$ ./install.sh
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@esp-2019r2-8.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Skipping openocd-esp32@v0.10.0-esp32-20190313 (already installed)
Installing Python environment and packages
Creating a new Python environment in /Users/Kefford/.espressif/python_env/idf4.0_py2.7_env
Installing virtualenv


This still leaves some questions:
1) Do I now have to checkout v3.2 of this IDF? ( ~/esp/esp-idf )
2) Do I need to do anything with the other IDF? ( ~/esp/esp-mdf/esp-idf )
3) Why do we need the IDF in two locations?

MattKefford
Posts: 4
Joined: Mon Jun 15, 2020 7:56 pm

Re: Error installing openocd during MDF setup step 2: Setup Toolchain

Postby MattKefford » Fri Jun 19, 2020 10:05 am

Continuing my journey with getting MDF set up, I have more feedback :) (assuming somebody will read this eventually :lol: )

In the quick start guide - https://github.com/espressif/esp-mdf
Step 4 says to do the following to copy a folder:
cp -r $MDF_PATH/examples/get-started/ .
cd get-started/

But this should probably be:
cp -r $MDF_PATH/examples/get-started .
cd get-started/

Otherwise it doesn't create a new folder but instead copies all the contents straight into your esp folder.

Also I believe I have an explanation for why we end up with two ESP-IDF folders.
If you follow the quick start guide it has you install MDF then directs you here set up the toolchain then you return to the first instructions and set up the MDF path. I'm assuming that at one time, MDF didn't contain IDF so this was necessary.

If you follow these instructions instead then they have you clone just MDF and set up the path. They must've combined IDF into MDF at this point so it was no longer necessary to do the toolchain part separately?

If that is the case then it's just a case of the instructions being out of date, and duplicated.

krsopl
Posts: 1
Joined: Thu Jul 09, 2020 12:00 pm

Re: Error installing openocd during MDF setup step 2: Setup Toolchain

Postby krsopl » Thu Jul 09, 2020 12:25 pm

Hi Matt,
So if I understand you correctly the final solution is to work with IDF ver. 4.0.1? Did you finally manage to run MDF correctly?
I would be very grateful for your feedback.

Who is online

Users browsing this forum: No registered users and 23 guests