Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Shu244 opened this issue Jan 12, 2025 · 3 comments

Comments

@Shu244
Copy link

Shu244 commented Jan 12, 2025

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

@github-actions github-actions bot changed the title Unable to debug ESP32-C3-DevKitC-02v1.1 on M1 MacOS using VS Code + ESP-IDF (But Flashing Code Works) Unable to debug ESP32-C3-DevKitC-02v1.1 on M1 MacOS using VS Code + ESP-IDF (But Flashing Code Works) (OCD-1063) Jan 12, 2025
@erhankur
Copy link
Collaborator

@Shu244
Copy link
Author

Shu244 commented Jan 12, 2025

Hi @erhankur thank you for taking a look. I was reading this doc

The quickest and most convenient way to start with JTAG debugging is through a USB cable connected to the D+/D- USB pins of ESP32-C3. No need for an external JTAG adapter and extra wiring/cable to connect JTAG to ESP32-C3.

I assumed that this means I can use the existing onboard micro USB on the dev board for debugging. Is this not the case?

Thinking about it more, I suppose the USB is connected to the USB-UART bridge and connected to UART pins rather than the MCU's USB D-/D+ pins. I wish the documents were a little more clear about explicitly needing a separate USB wire.

@erhankur
Copy link
Collaborator

@Shu244 do you still need some help from our side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants