No Source whilst Debugging ESP32-C3

Hi,

I’m trying to debug an ESP32-C3 using the built-in JTAG Interface.

The debugger runs fine and I can see it’s activity through the various debug watch windows, however the C source presented is static, and doesn’t indicate where in the code the debugger is halted.

[env:esp32dev]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino

monitor_speed=115200

build_flags = 
  -D ARDUINO_USB_MODE=1
  -D ARDUINO_USB_CDC_ON_BOOT=1

; upload_protocol = esp-builtin
debug_tool = esp-builtin
debug_init_break = tbreak setup
debug_server =
  $PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/bin/openocd
  -f
  $PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/share/openocd/scripts/board/esp32c3-builtin.cfg

Any clues or links appreciated.

M.

Sounds correct. When you use

the Arduino framework prebuilt ESP-IDF libraries at its base, which have no debug symbols or source code map to them.

If you need to debug something in those ESP-IDF functions (which you almost never ever have to do unless it’s in a very special situation), chose a framework type that builds Arduino-ESP32 but with ESP-IDF from source instead of using the prebuilt libs. Such project template exist in e.g.

Thanks, maxgerhardt.

Curious. I can get the esp-prog hardware debugger to debug an ESP32-WROOM-32 okay. Wouldn’t that have the same Arduino ESP-IDF libraries?

It’s just my very rudimentary application that I’m hoping to step through. Could I be missing debug symbols or a source code map from that?

M.

Maybe we’re talking past each other. When the debugging session has started up, can you press the “Pause” button and take a screenshot and post it here?

Got it working maxgerhardt, but not 100% sure the full setup required. Will update when 100% sure what’s needed.

Here we go, the full setup for an ESP32-C3 for programming, monitoring and debugging, on Platformio.

We use the inbuilt CMSIS-DAP device for JTAG uploads and debugging, and USB CDC Serial for programming and monitoring.

https://green.bug-eyed.monster/program-and-debug-the-esp32-c3/