Skip to content

Unable to debug ESP32-C3-DevKitC-02v1.1 on M1 MacOS using VS Code + ESP-IDF (But Flashing Code Works) (OCD-1063) #353

Closed
@Shu244

Description

@Shu244

Development Kit

ESP32-C3-DevKitC-02v1.1

Module or chip used

ESP32-C3-WROOM-02

Debug Adapter

Built-in JTAG

OpenOCD version

v0.12.0-esp32-20241016

Operating System

M1 Mac, MacOS 14.6.1

Using an IDE ?

VS Code with ESP-IDF extension

OpenOCD command line

Using VS Code built in debug button (settings below)

JTAG Clock Speed

N/A

ESP-IDF version

v5.4.0

Problem Description

I am unable to debug my ESP32 dev kit using the settings

{
    "C_Cpp.intelliSenseEngine": "default",
    "idf.espIdfPath": "/Users/shu/esp/esp-idf",
    "idf.openOcdConfigs": [
        "board/esp32c3-builtin.cfg"
    ],
    "idf.port": "/dev/tty.usbserial-110",
    "idf.toolsPath": "/Users/shu/.espressif",
    "files.associations": {
        "led_strip.h": "c"
    },
    "idf.flashType": "UART"
}

I get the error:

Open On-Chip Debugger v0.12.0-esp32-20241016 (2024-10-16-14:27)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

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!

❌ /Users/shuhao/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:9: Error: 
at file "/Users/shuhao/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 9
Error: [esp32c3] Unsupported DTM version: -1
Error: [esp32c3] Could not identify target type.

For assistance with OpenOCD errors, please refer to our Troubleshooting FAQ: https://github.com/espressif/openocd-esp32/wiki/Troubleshooting-FAQ
OpenOCD Exit with non-zero error code 1
[Stopped] : OpenOCD Server

I am able to flash the MCU, but I am unable to debug. I have been trying to get the debugging to work for many days and read a lot of the Espressif documentation, but none seem to help. Any help is greatly appreciated. Thank you!

Debug Logs

No response

Expected behavior

Enter debug mode.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions