libusb_open() failed with LIBUSB_ERROR_ACCESS when using openocd with Clion and ESP32

263 views Asked by At

I am trying to debug my code via jtag (esp prog) and openocd but every time it fails. I configured openocd environment in clion. enter image description here but after pressing debug this shows up:

C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin\openocd.exe -c "tcl_port disabled" -s C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\share\openocd\scripts -f board/esp32-wrover-kit-3.3v.cfg -c "program_esp C:/Users/dolph/OneDrive/Desktop/ESP-IDF-Led-Controller/FoViBalT-Led-Controller/cmake-build-debug/bootloader-flash_args 0x1000 verify" -c "program_esp C:/Users/dolph/OneDrive/Desktop/ESP-IDF-Led-Controller/FoViBalT-Led-Controller/cmake-build-debug/partition-table-flash_args 0x8000 verify" -c "program_esp C:/Users/dolph/OneDrive/Desktop/ESP-IDF-Led-Controller/FoViBalT-Led-Controller/cmake-build-debug/led_strip.bin 0x10000 verify" -c "init; reset" -c "echo \"** Program Flash Complete! **\"" -c shutdown
[0m[0mOpen On-Chip Debugger v0.12.0-esp32-20230921 (2023-09-21-13:40)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use
'transport select <transport>'.
** program_esp input args <0x1000 verify> **
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with description '*', serial '*' at bus locati
on '*'
** OpenOCD init failed **
shutdown command invoked
C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\share\open
ocd\scripts/target/esp_common.cfg:9: Error:
at file "C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\s
hare\openocd\scripts/target/esp_common.cfg", line 9

and when running openocd -f board/esp32-wrover-kit-3.3v.cfg it shows

Open On-Chip Debugger v0.12.0-esp32-20230921 (2023-09-21-13:40)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 500 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)
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Warn : target esp32.cpu1 examination failed
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40007BA1, debug_reason=00000000
Error: [esp32.cpu0] Timed out waiting for CPU to be reset, target state=2
Info : [esp32.cpu0] Reset cause (16) - (RTC WDT core and rtc reset)
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40007BA1, debug_reason=00000000
Info : [esp32.cpu0] Reset cause (16) - (RTC WDT core and rtc reset)
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40007BA1, debug_reason=00000000
Info : [esp32.cpu0] Reset cause (16) - (RTC WDT core and rtc reset)
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Warn : [esp32.cpu1] Unexpected OCD_ID = 00000000
Info : [esp32.cpu0] Debug controller was reset.

and continues to spam like this. I even tried changing board and interface to openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg and also this error pops up. All wiring are made right. And driver was updated several times via Zadig. I also tried to use different usb ports, but nothing helped. Maybe someone can help. I appreciate for any help

0

There are 0 answers