Page 1 of 1

Unable to launch debug in VSCode ESP-IDF ext with system-installed openocd

Posted: Mon Oct 12, 2020 2:40 pm
by xgaroux
Hi! I am facing the following problem:

I have installed ESP-IDF extension for VSCode with downloading all tools. It successfully installed, but in last step on checking tools was some error with openocd not found. I checked - it exist in .espressif/tools/openocd-esp32/v0.10.0-esp32-20191114 directory (I use Linux). This is first sign about some troubles.. But problem in other and previous fact is consequence of it:

I have already installed openocd in my system for other work purposes. It installed globally in system. So main problem is that when I start debug session ESP-IDF extension tries to launch system openocd version but not openocd-esp32. I tried add OPENOCD_BIN path variable in extension settings "Custom Extra Vars" section but have no result.

Could somebody help me to with it? How I can "tell" ESP-IDF extension to use its own openocd but not system version?

Thanks in advance, Michael.

Re: Unable to launch debug in VSCode ESP-IDF ext with system-installed openocd

Posted: Tue Oct 13, 2020 2:03 am
by ESP_bignacio
Can you make sure that openOCD bin folder is in Custom Extra Paths ? Should be something like (/home/username/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/bin)

Are you using PlatformIO ? If so try to disable it and try again to see if it works.

Re: Unable to launch debug in VSCode ESP-IDF ext with system-installed openocd

Posted: Tue Oct 13, 2020 8:27 am
by xgaroux
My Custom Extra Paths look like this:

Code: Select all

/home/user/.espressif/python_env/idf4.1_py3.8_env/bin:/usr/bin:/home/user/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin:/home/user/.espressif/tools/xtensa-esp32s2-elf/esp-2020r2-8.2.0/xtensa-esp32s2-elf/bin:/home/user/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/user/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/user/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin
When I write answer I noticed that directory "/usr/bin" appears early than "/home/user/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin". So first founded "openocd" binary was taken from /usr/bin. When I moved /usr/bin in the end of path string (after openocd-esp32 path) - problem was solved!

Also answer for second part of question - I don't use PlatformIO.

Thank you for answer! As is often the case, an outside perspective helps to identify the problem :)

But it should be noted that this Custom Extra Paths string was generated by VSCode ESP-IDF extension itself. I don't touch it before now. May be it should be checked in extension to change order of path string elements?

Re: Unable to launch debug in VSCode ESP-IDF ext with system-installed openocd

Posted: Fri Oct 16, 2020 4:25 am
by ESP_bignacio
Thank you for your feedback. We were adding in the extension to find system python but we are remaking the extension setup and we removed this from path.