espressif / openocd-esp32

OpenOCD branch with ESP32 JTAG support
Other
358 stars 131 forks source link

Can't debug on esp32c3 (OCD-1025) #343

Closed jsmith173 closed 3 days ago

jsmith173 commented 1 week ago

I'd like to run C and assembly level debugging in Eclipse using this product https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-devkitm-1/index.html

I played a lot but only the code upload is working (I tried in Arduino)

I have installed the latest ESP-IDF tool

OpenOCD shows the following error:


C:\Espressif\frameworks\esp-idf-v5.3.1>openocd -f board/esp32c3-builtin.cfg Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:26) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : only one transport option; autoselecting 'jtag' Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001 Info : esp_usb_jtag: capabilities descriptor set to 0x2000 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Error: esp_usb_jtag: could not find or open device! C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\share\openocd\scripts/target/esp_common.cfg:9: Error: at file "C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\share\openocd\scripts/target/esp_common.cfg", line 9 Error: [esp32c3] Unsupported DTM version: -1 Error: [esp32c3] Could not identify target type.

I tried it in both on Linux and Windows 11

Will help when we change the eFuse and using external JTAG?

Please help.

igrr commented 1 week ago

Hi @jsmith173,

Unfortunately this devkit has an external USB-serial converter (CP2102N) connected to the USB port, not the built-in USB_SERIAL_JTAG peripheral of the C3.

You have the following options for JTAG debugging:

I would recommend the first option as you don't need to make any permanent changes to the devkit.

Screenshot_20241020-102421

jsmith173 commented 1 week ago

We have also this development boards and we'd like c, asm sourve level debug in Eclipse https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-devkitc-1/index.html

These boards has the same problems also?

igrr commented 1 week ago

No, ESP32-C6 and ESP32-S3 devkits both have two USB ports — one for CP2102 (labelled "UART") and one for USB_SERIAL_JTAG (labelled "USB"). If you plug the cable into the port labelled "USB", debugging should work.