Cannot start a debug session in Espressif-IDE for ESP32-C6

RogerDavisWork
Posts: 7
Joined: Thu May 02, 2024 4:33 pm

Cannot start a debug session in Espressif-IDE for ESP32-C6

Postby RogerDavisWork » Sun Aug 04, 2024 8:06 pm

I am running Espressif-IDE version 2.12.0 under Windows and have been successfully developing, flashing, and running project within the environment on an ESP32-C6-WROOM-1 target.

I now wish to use the debugger and cannot get it to start. I have backed up to the hello world demo project to make sure it's not something in my code causing issues.

I have created a "hello_world Configuration" with default settings. The Configuration options line is:
-s ${openocd_path}/share/openocd/scripts -f board/esp32c6-builtin.cfg

When I try to launch the debugger, it states this in the Details:

Code: Select all

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: Connection timed out.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: Connection timed out.
localhost:3333: Connection timed out.
If I open up a command line and type "idf.py openocd" I get this:

Code: Select all

Executing action: openocd
Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument)
OpenOCD arguments default to: "-f board/esp32c6-builtin.cfg"
OpenOCD started as a background task 41060
Executing action: post_debug
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 : 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-20230921\openocd-esp32\share\openocd\scripts/target/esp_common.cfg:9: Error:
at file "C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\share\openocd\scripts/target/esp_common.cfg", line 9
"openocd" exited with 1
HINT: Please check the wire connection to debugging device or access rights to a serial port.
I am not sure why it can't find a connection when I can flash and run without using the debugger.

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

Re: Cannot start a debug session in Espressif-IDE for ESP32-C6

Postby ESP_Sprite » Tue Aug 06, 2024 9:19 am

Code: Select all

Error: esp_usb_jtag: could not find or open device!
How are you connecting the ESP32-C6 to your PC?

M4L4SS1S3
Posts: 2
Joined: Tue Aug 06, 2024 3:44 am

Re: Cannot start a debug session in Espressif-IDE for ESP32-C6

Postby M4L4SS1S3 » Tue Aug 06, 2024 5:27 pm

Hello friend, I managed to make the debug work via GDB by creating a permission file in the system rules in udev, in my case I use Debian Linux, in /etc/udev/rules/70-openocd.rules
I know that in Windows it is different, but it can be a guide for you to take a look at device permissions.

ACTION!="add|change", GOTO="openocd_rules_end"
SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess"
SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
# USBprog with OpenOCD firmware
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Espressif USB JTAG/serial debug units
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess" ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess"

RogerDavisWork
Posts: 7
Joined: Thu May 02, 2024 4:33 pm

Re: Cannot start a debug session in Espressif-IDE for ESP32-C6

Postby RogerDavisWork » Tue Aug 20, 2024 5:50 pm

The answer to this issue was that there are two USB ports on the target. One is for UART/Flashing and the other is for JTag debugging.

Who is online

Users browsing this forum: Bing [Bot] and 24 guests