libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby AnthonyThet » Sun Dec 26, 2021 5:37 am

Hi, I am using a ESP32-WROVER-KIT and trying to debug a simple blink example project in VSCode.
I have set up the hardware jumper configurations for JTAG debugging
Imageand followed the steps as mentioned in the "https://github.com/espressif/vscode-esp ... bugging.md".
I have also used Zadig to change Interface 0 driver to WinUSB driver and I can also see a separate UART COM port for flashing and "Dual RS-232 HS" port as well.
I can also build the blink project and when I tried to run "openocd -f board/esp32-wrover-kit-3.3v.cfg" cmd, I still got the following errors.

Code: Select all

Open On-Chip Debugger  v0.10.0-esp32-20210401 (2021-04-01-15:46)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : Listening on port 3333 for gdb connections
Please help me to solve this issue. Thanks so much in advance...

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby ESP_Sprite » Mon Dec 27, 2021 1:08 am

This is more or less what I'd expect a correct OpenOCD session to show: it has initialized, detected the ESP32 and is now waiting for gdb (or anything else) to connect to it to tell it what to do. You can ignore the error in the title of your post; it's likely OpenOCD trying to open something else (not sure what, maybe the entire FT2232 instead of part of the composite device) before finding the correct node.

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby AnthonyThet » Mon Dec 27, 2021 1:01 pm

Hi ESP_Sprite, thanks so much for your prompt reply. Now I have another issue, gdb configurations issue but I will try and post as another topic. Thanks again...

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby AnthonyThet » Mon Dec 27, 2021 1:48 pm

Hi ESP_Sprite, after I proceed to run debugger from the command line

Code: Select all

xtensa-esp32-elf-gdb -x gdbinit build/blink.elf
and I found this error:

Code: Select all

GNU gdb (crosstool-NG esp-2021r1) 8.1.0.20180627-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_w64-mingw32 --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/blink.elf...done.
gdbinit:1: Error in sourced command file:
:3333: No connection could be made because the target machine actively refused it.
Is it because of the
libusb_open()
failed issue?
I have already put the required parameters inside a gdbinit file and save it.
Thanks...

Thanks.

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby ESP_Sprite » Tue Dec 28, 2021 1:58 am

First of all, I'm assuming you do this while OpenOCD is running as well (e.g. in another terminal)? If not, that's your problem. If you have that, that's a bit odd... OpenOCD says it's listening on that port. Perhaps you have a firewall installed that blocks connections like this?

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby AnthonyThet » Tue Dec 28, 2021 2:04 pm

Hi ESP_Sprite, thanks so much for your prompt reply and suggestion. And yes, you're right, I didn't run in another terminal and now when I run in another terminal, it seems work but now I tried to add some configurations in launch.json as follow,

Code: Select all

{
    "preLaunchTask": "preRun",
    "type": "cppdbg",
    "name": "ESP32 OpenOCD",
    "request": "launch",
    "cwd": "${workspaceFolder}/build",
    "program": "${workspaceFolder}/build/blink.elf",
    "miDebuggerPath": "C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe",
    "setupCommands": [
      {"text": "target remote localhost:3333"},
      {"text": "set remote hardware-watchpoint-limit 2"},
      {"text": "monitor reset halt"},
      {"text": "flushregs"},
      {"text": "mon program_esp build/bootloader/bootloader.bin 0x1000 verify"},
      {"text": "mon program_esp build/partition_table/partition-table.bin 0x8000 verify"},
      {"text": "mon program_esp build/blink.bin 0x10000"},
      {"text": "monitor reset halt"},
      {"text": "flushregs"}
    ]
  }
and my preRun task will be as follow in tasks.json

Code: Select all

{
            "label": "preRun",
            "type": "shell",
            "windows": {
                "command": "clear and start openocd -c \"set ESP_RTOS none\" -f board/esp32-wrover-kit-3.3v.cfg '&' exit" 
            }
 }
just to automate the process according to a youtube video instructions
https://www.youtube.com/watch?v=uq93H7T7cOQ
But after I have done everything and press F5 to start debugging, it doesn't direct me to the source code, I couldn't find the yellow highlighted line as in this image.
Image
I have no idea whats happening behind, I am really lost and don't know how to procced...

For your info, the following are the messages appeared in cppdbg terminal when I press F5 key,

Code: Select all

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-l3whtnsk.rk5' '--stdout=Microsoft-MIEngine-Out-ttemoxzw.nww' '--stderr=Microsoft-MIEngine-Error-1nlb0jxn.sdp' '--pid=Microsoft-MIEngine-Pid-zajho3z3.x5i' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-nvghb0vr.maz' '--stdout=Microsoft-MIEngine-Out-302hxzk1.qri' '--stderr=Microsoft-MIEngine-Error-ow04saus.fph' '--pid=Microsoft-MIEngine-Pid-1nh1n1ny.4us' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-jsnuxiow.r4z' '--stdout=Microsoft-MIEngine-Out-zpnsyiw2.y20' '--stderr=Microsoft-MIEngine-Error-12lsu3ik.wm2' '--pid=Microsoft-MIEngine-Pid-uy0mkqpj.oz5' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-l5ofehv3.4js' '--stdout=Microsoft-MIEngine-Out-dkj3zapn.xqp' '--stderr=Microsoft-MIEngine-Error-a34la2be.gvz' '--pid=Microsoft-MIEngine-Pid-l02u5kum.jnk' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-stipgic5.rph' '--stdout=Microsoft-MIEngine-Out-03ijegiy.frz' '--stderr=Microsoft-MIEngine-Error-3cin0yyq.ol5' '--pid=Microsoft-MIEngine-Pid-tsmp0zhi.nn0' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-5pjmysx1.xhu' '--stdout=Microsoft-MIEngine-Out-cx0bnjzt.asb' '--stderr=Microsoft-MIEngine-Error-qhmooss0.q3q' '--pid=Microsoft-MIEngine-Pid-gtmpnk0y.cgo' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-tb2dzpm1.c2q' '--stdout=Microsoft-MIEngine-Out-b12jrsnp.pna' '--stderr=Microsoft-MIEngine-Error-v4luukmr.cio' '--pid=Microsoft-MIEngine-Pid-5h4puwtg.cgc' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-g1kjc0gp.ns4' '--stdout=Microsoft-MIEngine-Out-1d31jhzr.ca3' '--stderr=Microsoft-MIEngine-Error-d2iehpvx.rq5' '--pid=Microsoft-MIEngine-Pid-rqyt5re0.eoh' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-n22prbkh.5rr' '--stdout=Microsoft-MIEngine-Out-q3lrvd1w.ypt' '--stderr=Microsoft-MIEngine-Error-tnz2aief.dtv' '--pid=Microsoft-MIEngine-Pid-4gkx4mzw.kwa' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
PS D:\esp32_vscode_proj\blink>  & 'c:\Users\anton\.vscode\extensions\ms-vscode.cpptools-1.8.0-insiders2\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-tmuzkl4m.s0u' '--stdout=Microsoft-MIEngine-Out-pdg1rhf4.czr' '--stderr=Microsoft-MIEngine-Error-nnsxvlbz.orp' '--pid=Microsoft-MIEngine-Pid-evqhe1fr.cv5' '--dbgExe=C:/Users/anton/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' '--interpreter=mi'
and the following messages are in 'Debug Console' terminal...

Code: Select all

=thread-group-added,id="i1"
GNU gdb (crosstool-NG esp-2021r1) 8.1.0.20180627-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_w64-mingw32 --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
Thanks so much again for your patience and great help and apology for my lack of knowledge in these basic setups...

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby ESP_Sprite » Wed Dec 29, 2021 2:31 am

Sorry, I can't help you there as I'm not familiar with VSCode.

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby AnthonyThet » Sat Jan 01, 2022 3:06 am

Hi ESP_Sprite, thanks so much and much appreciated for your help so far. Let me try with Eclipse first just to make sure my hardware setup is correct. And then I will try again with VSCode again...

Balcon
Posts: 2
Joined: Fri Oct 14, 2022 6:03 pm

Re: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Postby Balcon » Fri Oct 14, 2022 6:47 pm

Immagine 2022-10-14 185751.png
Immagine 2022-10-14 185751.png (202.46 KiB) Viewed 6999 times
COM31 - PuTTY 14_10_2022 18_50_55.png
COM31 - PuTTY 14_10_2022 18_50_55.png (88.67 KiB) Viewed 6999 times
workspace - E__esp-idf-v4.4_examples_get-started_hello_world_main_hello_world_main.c - Espressif-IDE 14_10_2022 20_29_32.png
workspace - E__esp-idf-v4.4_examples_get-started_hello_world_main_hello_world_main.c - Espressif-IDE 14_10_2022 20_29_32.png (147.13 KiB) Viewed 6999 times
I too had this reply, or worse Lib usb not found. Then I tried again
https://docs.espressif.com/projects/esp ... -jtag.html .
First WROVER-KIT-V4.1 must be connected to Window PC through USB or any USB HUB: device manager will show 2 drivers, one for UART(A) an the other for JTAG (B). Now run Zadig and the driver in Device manager will remain only one: JTAG COM port. The board must always use this port or you have to run Zadig again.
Follow
https://docs.espressif.com/projects/esp ... un-openocd . I get more or less the first 10 lines of Immagine 2022-10-14 185751.png : no more errors.
Write this COM port in the Espress-IDE Target combobox.
Follow
https://docs.espressif.com/projects/esp ... er-eclipse . Launch the debugger from IDE. I get COM31-PuTTY14_10_202218_50_55.png and workspace - E__esp-idf-v4.4_examples_get-started_hello_world_main_hello_world_main.c - Espressif-IDE 14_10_2022 20_29_32.png. During my first clumsy attempts, only Teraterm was able to see the app output, but now also the less sophisticated PuTTY can.

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 117 guests