Page 1 of 1

ESP32-C3 OpenOCD issue

Posted: Thu Jul 08, 2021 2:21 pm
by stefano664
Dear all,
I'm trying to connect with JTAG to ESP32-C3, using built in interface on USB pins. I connected this and I can see JTAG device in Windows USB device's list. But when I launch debugger with:

openocd -f board/esp32c3-builtin.cfg

This happens:

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 : only one transport option; autoselect 'jtag'
Warn : Transport "jtag" was already selected
force hard breakpoints
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: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : datacount=2 progbufsize=16
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101104
Info : Listening on port 3333 for gdb connections
Info : Hart 0 unexpectedly reset
Info : Hart 0 unexpectedly reset
Info : Hart 0 unexpectedly reset
Error: esp_usb_jtag: usb sent only 0 out of 17 bytes.
Error: missing data from bitq interface
Error: dmi_scan failed jtag scan
Error: failed read at 0x11, status=2
Error: esp_usb_jtag: usb sent only 0 out of 34 bytes.
Error: missing data from bitq interface
Error: dmi_scan failed jtag scan
Error: failed read at 0x11, status=2
...


Some help?

Best regards,
Stefano

Re: ESP32-C3 OpenOCD issue

Posted: Thu Jul 08, 2021 8:33 pm
by ESP_igrr
Hi Stefano,

What program do you have running on the ESP32-C3 when this issue occurs? Does this program re-configure any GPIOs? Similar errors may occur if the program configures one of the JTAG pins for a different purpose.

I suggest flashing some example like get-started/hello_world to the chip to see if this changes anything.

If the problem still occurs, could you please open an issue at https://github.com/espressif/openocd-esp32/issues, supplying the following:
* OpenOCD output at debug level (by adding -d3 argument to OpenOCD command line, see https://docs.espressif.com/projects/esp ... penocd-gdb)
* Serial output (sent via UART, if you are using the default sdkconfig, or via USB-CDC if you have enabled CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG)

Re: ESP32-C3 OpenOCD issue

Posted: Fri Jul 09, 2021 2:47 am
by BrianP
Stefano

I humbly suggest you read this post https://www.esp32.com/viewtopic.php?f=40&t=21809.

It's not just for Eclipse. At a minimum I'd suggest you download/make the June OpenOCD binary.

Re: ESP32-C3 OpenOCD issue

Posted: Fri Jul 09, 2021 8:29 am
by stefano664
ESP_igrr wrote:
Thu Jul 08, 2021 8:33 pm
What program do you have running on the ESP32-C3 when this issue occurs? Does this program re-configure any GPIOs? Similar errors may occur if the program configures one of the JTAG pins for a different purpose.
I running the hello_world example... :-D

Re: ESP32-C3 OpenOCD issue

Posted: Fri Jul 09, 2021 8:47 am
by stefano664
BrianP wrote:
Fri Jul 09, 2021 2:47 am
Stefano

I humbly suggest you read this post https://www.esp32.com/viewtopic.php?f=40&t=21809.

It's not just for Eclipse. At a minimum I'd suggest you download/make the June OpenOCD binary.
Thanks. Following these post the question is to use master branch instead current release.

Thanks for your help.

Best regards,
Stefano

Re: ESP32-C3 OpenOCD issue

Posted: Fri Jul 09, 2021 12:51 pm
by BrianP
Let me know how it goes. As that post suggests there are a lot of interlocking bugs, documentation issues, etc., with ESP-IDF and ESP32-C3. I can reliably get JTAG to work now.