Closed Panometric closed 1 year ago
Can anyone help on this, it's so annoying.. I CAN debug, but the vscode extension pops up this error every session.
Others have reported since 2018... https://www.esp32.com/viewtopic.php?t=5580
cc @kolipakakondal
Hi @Panometric
libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
This is ok for windows and the JTAG connection should work even with this. Looking at the above console log messages I don't see any other error.
However, run https://visualgdb.com/UsbDriverTool/ instead of Zadig for installation of libusb and see if that helps to avoid the above error as well.
@kolipakakondal Thanks for that tip. I tried the WinUSB driver on VID 303A DevID 1001 Interface 2. Got the same error.
This is what I understood was the correct way, per "Please install the WinUSB driver only for the interface where there is no driver installed (probably it is Interface 2) and do not re-install the driver for the other interface."
But then I noticed UsbDriverTool also shows the composite device that Zadig does not. So I installed libusb to the Composite Device and rebooted the device, and JTAG was fixed. BUT, there is no Serial port anymore, only JTAG.
Note on interface 2, when debugging over JTAG and having the serial monitor on that I was also having unexpected DIR errors. I have set my clock speed down to 20000, as was suggested "In particular reduce frequency, if you get DSR/DIR errors " it has not gotten rid of the errors.
So perhaps there is more to this problem than just an unwanted message. It seems to be related to having a composite device.
Either way, there does not seem to be a solution that does not break something.
Log showing unchanged error with UsbDriverTool on Interface 2.
Open On-Chip Debugger v0.11.0-esp32-20220411 (2022-04-11-08:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
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 : esp_usb_jtag: serial (F4:12:FA:C1:A1:64)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 20000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Hi @Panometric I have updated libusb version to 1.0.26. Looks like the error disappeared in my windows machine. (Win10)
Can you also test and verify with the attached package?
c:\esp_\openocd-esp32\bin>openocd.exe -s ..\share\openocd\scripts -f board/esp32s3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20221026-87-gd269916f (2023-01-16-14:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : esp_usb_jtag: serial (7C:DF:A1:E1:19:00)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32s3.cpu0] Target halted, PC=0x4037A9E0, debug_reason=00000000
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
Info : [esp32s3.cpu1] Target halted, PC=0x4037A9E0, debug_reason=00000000
Info : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
@erhankur Just updating the driver didn't do it, but the package did. Where/ when will this be officially released? Thanks!
Glad it worked for you, too. The official release date is not decided yet. Until release, you can just replace openocd-esp32 folder under .espressif\tools\openocd-esp32\<your version>\
We have backward compatibility between idf versions. So
there should be no new issue.
Hello I found same issues.
OS : Ubuntu VScode ESP-IDF : 5.2.0 Hardware : ESP32-2424S012 // ESP32-C3 with Round display
`/home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin/openocd
Open On-Chip Debugger v0.12.0-esp32-20230419 (2023-04-18-22:02) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html
/home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin/openocd
[OpenOCD] Open On-Chip Debugger v0.12.0-esp32-20230419 (2023-04-18-22:02) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html User : 3 1 options.c:52 configuration_output_handler(): debug_level: 3User : 4 1 options.c:52 configuration_output_handler(): Debug: 5 1 options.c:233 add_default_dirs(): bindir=/builds/idf/openocd-esp32/_build/../openocd-esp32/bin Debug: 6 1 options.c:234 add_default_dirs(): pkgdatadir=/builds/idf/openocd-esp32/_build/../openocd-esp32/share/openocd Debug: 7 1 options.c:235 add_default_dirs(): exepath=/home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin Debug: 8 1 options.c:236 add_default_dirs(): bin2data=../share/openocd Debug: 9 1 configuration.c:33 add_script_search_dir(): adding /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts Debug: 10 1 configuration.c:33 add_script_search_dir(): adding /home/sirapol/.config/openocd Debug: 11 1 configuration.c:33 add_script_search_dir(): adding /home/sirapol/.openocd Debug: 12 1 configuration.c:33 add_script_search_dir(): adding /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin/../share/openocd/site Debug: 13 1 configuration.c:33 add_script_search_dir(): adding /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin/../share/openocd/scripts Debug: 14 1 command.c:152 script_debug(): command - ocd_find board/esp32c3-builtin.cfg Debug: 15 1 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/board/esp32c3-builtin.cfg Debug: 16 1 command.c:152 script_debug(): command - ocd_find interface/esp_usb_jtag.cfg Debug: 17 1 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/interface/esp_usb_jtag.cfg Debug: 18 1 command.c:152 script_debug(): command - adapter driver esp_usb_jtag
[OpenOCD]
Info : 19 1 transport.c:107 allow_transports(): only one transport option; autoselecting 'jtag'
Debug: 20 1 command.c:152 script_debug(): command - espusbjtag vid_pid 0x303a 0x1001
Info : 21 1 esp_usb_jtag.c:894 esp_usb_jtag_vid_pid(): esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Debug: 22 1 command.c:152 script_debug(): command - espusbjtag caps_descriptor 0x2000
Info : 23 1 esp_usb_jtag.c:905 esp_usb_jtag_caps_descriptor(): esp_usb_jtag: capabilities descriptor set to 0x2000
Debug: 24 1 command.c:152 script_debug(): command - adapter speed 40000
Debug: 25 1 adapter.c:253 adapter_config_khz(): handle adapter khz
Debug: 26 1 adapter.c:217 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 27 1 adapter.c:217 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 28 1 command.c:152 script_debug(): command - ocd_find target/esp32c3.cfg
Debug: 29 1 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp32c3.cfg
Debug: 30 1 command.c:152 script_debug(): command - transport select jtag
Warn : 31 1 transport.c:280 handle_transport_select(): Transport "jtag" was already selected
Debug: 32 1 command.c:152 script_debug(): command - ocd_find bitsbytes.tcl
Debug: 33 1 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/bitsbytes.tcl
Debug: 34 2 command.c:152 script_debug(): command - ocd_find memory.tcl
Debug: 35 2 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/memory.tcl
Debug: 36 2 command.c:152 script_debug(): command - ocd_find mmr_helpers.tcl
Debug: 37 2 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/mmr_helpers.tcl
Debug: 38 2 command.c:152 script_debug(): command - ocd_find target/esp_common.cfg
Debug: 39 2 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_common.cfg
Debug: 40 2 command.c:152 script_debug(): command - ocd_find target/esp_version.cfg
Debug: 41 2 configuration.c:88 find_file(): found /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_version.cfg
Debug: 42 2 command.c:152 script_debug(): command - version
Debug: 43 2 command.c:152 script_debug(): command - add_help_text program_esp write an image to flash, address is only required for binary images. verify, reset, exit, compress, restore_clock and encrypt are optional
Debug: 44 2 command.c:152 script_debug(): command - add_usage_text program_esp format
argument to return formatted MAC value
Debug: 48 2 command.c:152 script_debug(): command - add_usage_text esp_get_mac [format]
Debug: 49 2 command.c:152 script_debug(): command - jtag newtap esp32c3 cpu -irlen 5 -expected-id 0x00005c25
Debug: 50 2 tcl.c:562 jim_newtap_cmd(): Creating New Tap, Chip: esp32c3, Tap: cpu, Dotted: esp32c3.cpu, 4 params
Debug: 51 2 tcl.c:579 jim_newtap_cmd(): Processing option: -irlen
Debug: 52 2 tcl.c:579 jim_newtap_cmd(): Processing option: -expected-id
Debug: 53 2 core.c:1478 jtag_tap_init(): Created Tap: esp32c3.cpu @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 54 2 command.c:152 script_debug(): command - target create esp32c3 esp32c3 -chain-position esp32c3.cpu -rtos FreeRTOS
Debug: 55 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas
Debug: 56 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas
Debug: 57 2 FreeRTOS.c:1414 freertos_create(): freertos_create
[OpenOCD] Debug: 58 2 command.c:286 register_command(): command 'esp' is already registered Debug: 59 2 command.c:286 register_command(): command 'esp32c3 esp' is already registered Debug: 60 2 command.c:152 script_debug(): command - esp32c3 configure -event reset-assert-post esp32c3_soc_reset Debug: 61 2 command.c:152 script_debug(): command - esp32c3 configure -event halted esp32c3_wdt_disable esp halted_event_handler
Debug: 62 2 command.c:152 script_debug(): command - esp32c3 configure -event examine-end
arm semihosting enable
arm semihosting_resexit enable
if { [info exists _SEMIHOST_BASEDIR] } {
if { $_SEMIHOST_BASEDIR != "" } {
arm semihosting_basedir $_SEMIHOST_BASEDIR
}
}
Debug: 63 2 command.c:152 script_debug(): command - esp32c3 configure -event gdb-detach $_TARGETNAME esp gdb_detach_handler
Debug: 64 2 command.c:152 script_debug(): command - esp32c3 configure -event gdb-attach
halt 1000
if { [esp32c3_memprot_is_enabled] } {
# 'reset halt' to disable memory protection and allow flasher to work correctly
echo "Memory protection is enabled. Reset target to disable it..."
reset halt
}
# by default mask interrupts while stepping
riscv set_maskisr steponly
Debug: 65 2 command.c:152 script_debug(): command - esp32c3 configure -work-area-phys 0x40380000 -work-area-virt 0x40380000 -work-area-size 0x4000 -work-area-backup 1 Debug: 66 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 67 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 68 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 69 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 70 2 command.c:152 script_debug(): command - esp32c3 configure -alt-work-area-phys 0x3FC84000 -alt-work-area-virt 0x3FC84000 -alt-work-area-size 0x20000 -alt-work-area-backup 1 Debug: 71 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 72 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 73 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 74 2 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas Debug: 75 2 command.c:152 script_debug(): command - flash bank esp32c3.flash esp32c3 0x0 0 0 0 esp32c3 Debug: 76 2 command.c:286 register_command(): command 'esp' is already registered Debug: 77 2 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing Debug: 78 2 command.c:152 script_debug(): command - flash bank esp32c3.irom esp32c3 0x0 0 0 0 esp32c3 Debug: 79 2 command.c:286 register_command(): command 'esp' is already registered Debug: 80 2 command.c:286 register_command(): command 'esp appimage_offset' is already registered Debug: 81 2 command.c:286 register_command(): command 'esp compression' is already registered Debug: 82 2 command.c:286 register_command(): command 'esp verify_bank_hash' is already registered Debug: 83 2 command.c:286 register_command(): command 'esp flash_stub_clock_boost' is already registered Debug: 84 2 command.c:286 register_command(): command 'esp encrypt_binary' is already registered Debug: 85 2 command.c:286 register_command(): command 'esp stub_log' is already registered Debug: 86 2 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing Debug: 87 3 command.c:152 script_debug(): command - flash bank esp32c3.drom esp32c3 0x0 0 0 0 esp32c3 Debug: 88 3 command.c:286 register_command(): command 'esp' is already registered Debug: 89 3 command.c:286 register_command(): command 'esp appimage_offset' is already registered Debug: 90 3 command.c:286 register_command(): command 'esp compression' is already registered Debug: 91 3 command.c:286 register_command(): command 'esp verify_bank_hash' is already registered Debug: 92 3 command.c:286 register_command(): command 'esp flash_stub_clock_boost' is already registered Debug: 93 3 command.c:286 register_command(): command 'esp encrypt_binary' is already registered Debug: 94 3 command.c:286 register_command(): command 'esp stub_log' is already registered Debug: 95 3 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing Debug: 96 3 command.c:152 script_debug(): command - riscv set_reset_timeout_sec 2 Debug: 97 3 command.c:152 script_debug(): command - riscv set_command_timeout_sec 5 Debug: 98 3 command.c:152 script_debug(): command - riscv set_mem_access sysbus progbuf abstract Debug: 99 3 command.c:152 script_debug(): command - riscv set_ebreakm on Debug: 100 3 command.c:152 script_debug(): command - riscv set_ebreaks on Debug: 101 3 command.c:152 script_debug(): command - riscv set_ebreaku on Info : 102 3 server.c:298 add_service(): Listening on port 6666 for tcl connections Info : 103 3 server.c:298 add_service(): Listening on port 4444 for telnet connections Debug: 104 3 command.c:152 script_debug(): command - init Debug: 105 3 command.c:152 script_debug(): command - target init Debug: 106 3 command.c:152 script_debug(): command - target names Debug: 107 3 command.c:152 script_debug(): command - esp32c3 cget -event gdb-flash-erase-start Debug: 108 3 command.c:152 script_debug(): command - esp32c3 configure -event gdb-flash-erase-start reset init Debug: 109 3 command.c:152 script_debug(): command - esp32c3 cget -event gdb-flash-write-end Debug: 110 3 command.c:152 script_debug(): command - esp32c3 configure -event gdb-flash-write-end reset halt Debug: 111 3 command.c:152 script_debug(): command - esp32c3 cget -event gdb-attach Debug: 112 3 target.c:1657 handle_target_init_command(): Initializing targets... Debug: 113 3 riscv.c:444 riscv_init_target(): riscv_init_target() Debug: 114 3 semihosting_common.c:107 semihosting_common_init():
[OpenOCD] ❌ Error: 115 6 libusb_helper.c:179 jtag_libusb_open(): libusb_open() failed with LIBUSB_ERROR_ACCESS
[OpenOCD] ❌ Error: 116 6 esp_usb_jtag.c:646 esp_usb_jtag_init(): esp_usb_jtag: could not find or open device! Debug: 117 6 command.c:542 run_command(): Command 'init' failed with error code -4 User : 118 6 command.c:613 command_run_line(): /home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:4: Error: at file "/home/sirapol/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 4 Debug: 119 6 riscv.c:490 riscv_deinit_target(): riscv_deinit_target() Debug: 120 6 target.c:2223 target_free_all_working_areas_restore(): freeing all working areas
[OpenOCD] [Stopped] : OpenOCD Server [Flash] Can't perform JTag flash, because OpenOCD server is not running!`
@sirapol Did you follow the instructions outlined here
Have you ensured that USB_SERIAL_JTAG is not disabled in the EFUSE?
@sirapol > LIBUSB_ERROR_ACCESS is not the same error at all . Please delete to prevent complicating the issue.
Thank you everyone
Development Kit
esp32-box
Module or chip used
ESP32-S3
Debug Adapter
Built-in JTAG
OpenOCD version
v0.11.0-esp32-20220411 (2022-04-11-08:48)
Operating System
Windows
Using an IDE ?
no, bit in VScode IDE, this error generates an annoying popup every time openocd starts.
OpenOCD command line
openocd -d3 -f board/esp32-wrover-kit-3.3v.cfg 2>&1 | tee openocd.log
JTAG Clock Speed
default 40000
ESP-IDF version
4.4.2
Problem Description
Erroneous error on startup: "Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED"
PS C:\DCI\spi_lcd\lcd> openocd -f board/esp32s3-builtin.cfg Open On-Chip Debugger v0.11.0-esp32-20220411 (2022-04-11-08:48) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : only one transport option; autoselect 'jtag' Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001 Info : esp_usb_jtag: capabilities descriptor set to 0x2000 Warn : Transport "jtag" was already selected 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 : esp_usb_jtag: serial (F4:12:FA:C1:A1:64) Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255 Info : clock speed 40000 kHz Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : starting gdb server for esp32s3.cpu0 on 3333 Info : Listening on port 3333 for gdb connections
Debug Logs
Expected behavior
Do not report an Error if connection is OK.
Screenshots
No response