Cannot debug ESP32-C3 with ESP Prog

ristiale
Posts: 2
Joined: Wed Jul 19, 2023 8:31 pm

Cannot debug ESP32-C3 with ESP Prog

Postby ristiale » Wed Jul 19, 2023 10:04 pm

I'm currently experiencing an issue with debugging my ESP32-C3 using the ESP-Prog. I've been encountering an error where the ESP-Prog shows all zeroes during the debug process.

Here's the setup and steps I've already taken:
  • I'm using MacOS Ventura 13.4.1. on my MacBook Pro M1, I'm editing the code in Visual studio code with the help of ESP-IDF extension
  • I've triple checked connection between the ESP32 C3 and the ESP-Prog and it is correct /list]
    • The correct board (ESP32 C3) is selected in my IDE.
    • I've powered ESP32-C3 and ESP Prog independently to eliminate any power related issues.
    • I've erased the flash memory of my ESP32 C3 using esptool.py, but the problem persists.
    • I'm using the latest version of the ESP-IDF
    • I've disconnected all peripherals from the GPIO pins
    • I'm trying to debug sample code hello-world from Espressif sample library, I'm able to flash the MCU but I'm not able to debug it
    Despite following these steps, I'm still getting all zeroes from the ESP-Prog during debugging.I'm afraid that there is an driver incompatibility.

    I would greatly appreciate any help or suggestions on how to resolve this issue.

    Here is the message from ESP-IDF:

    /Users/ristiale/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin/openocd

    [Debug Adapter]
    DEBUG_ADAPTER_STARTED
    2023-07-19 22:30:04,280 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED

    [Debug Adapter]
    DEBUG_ADAPTER_READY2CONNECT
    2023-07-19 22:30:04,282 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT

    [OpenOCD]
    Info : accepting 'gdb' connection on tcp/3333
    Error: Target not examined yet
    Error executing event gdb-attach on target esp32c3:

    Warn : No symbols for FreeRTOS!
    Error: Target not halted
    Error: auto_probe failed
    Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
    Error: attempted 'gdb' connection rejected

    [Debug Adapter]
    DEBUG_ADAPTER_STOPPED
    2023-07-19 22:30:14,505 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STOPPED

    [Stopped] : ESP-IDF Debug Adapter

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

Re: Cannot debug ESP32-C3 with ESP Prog

Postby ESP_Sprite » Thu Jul 20, 2023 1:59 am

The ESP32-C3 routes its JTAG to its internal USB-serial-JTAG peripheral by default; if you want to use an external JTAG adapter you need to burn a fuse. (Or alternatively, use the USB-serial-JTAG peripheral to debug the thing.)

ristiale
Posts: 2
Joined: Wed Jul 19, 2023 8:31 pm

Re: Cannot debug ESP32-C3 with ESP Prog

Postby ristiale » Thu Jul 20, 2023 7:47 am

Thank you very much for quick response. Your advice solved my problem! :) After I've burnt the eFuse with command:
"espefuse.py --port /dev/cu.wchusbserial533B0062341 burn_efuse DIS_USB_JTAG 1", the ESP prog and ESP32-C3 started to communicate.

Note for others reading this post: The process is irreversible, you cannot change the bit back to 0.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 105 guests