Problem debugging esp32-wroom-32

Hello! I am trying to debug a code on the board esp32-wroom-32. I’ve never debugged.
After some search in the community, I found that I have to add the debug tool on the file platform.ini. But I can’t find the debug tool for my board (according to documentation it’s JTAG ). I’ve chosen JTAG-HS1 but I get Error: Unknown debug tool digilent-hs1. Please use one of esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa or custom . When I try one of the suggested debug-tool , I get the notification BadCMake executable ; Set up and build your CMake project before debuging and debug fails.

Here are my configurations of platformio.ini:

platform = espressif32
board = mhetesp32devkit
framework = espidf
monitor_speed = 115200
debug_tool = olimex-jtag-tiny

with step did I miss?

This is indeed unknown – you can only chose the supported debug adapters for your board as listed per documentation.

Do you have the CMake or ESP-IDF plugin installed in VSCode too, by any chance? Those seem to interfere.

You should first try and create a new blank project via the PIO Home Create Project wizard for ESP-IDF, then fill it e.g. with the blinky code from the official example, build and flash it normally, and then add debug directives to the platformio.ini and debug that.

I installed Espressif 32, Espressif 8266 and CMake. Now I am using the gatts_demo example. The blinking example built properly but I didn’t debug it.

I opened the link in your comment and found the information:
MH ET LIVE ESP32DevKIT does not have on-board debug probe and IS NOT READY for debugging. You will need to use/buy one of external probe listed below.
I think it is the problem

Not ready meaning you must connect a JTAG debug probe to it – it will be debuggable once you do that. Since you talk about the JTAG-HS1 that’s your debug tool?

(A general reference for JTAG debugging is at Low-cost ESP32 In-circuit Debugging | by Manuel Bl. | Medium)

no. I just chose it randomly because it was nearer to the expression JTAG(what is written on datasheet). I don’t have an external programmer

A JTAG debug probe is needed for debugging, otherwise PlatformIO can’t see that state of the ESP32’s processors.

1 Like