Skip to content

ESP32C3 GDB can't connect through USB built-in JTAG (OCD-412) #182

Closed
@jeancf

Description

@jeancf

Environment

  • Development Kit: Ai-Thinker NodeMCU Series ESP32-C3S Kit and Lilygo TTGO T-OI PLUS
  • Module or chip used: ESPC32C3
  • Debug Adapter: USB built-in
  • OpenOCD version: v0.10.0-esp32-20210902
  • Operating System: Linux (Arch)
  • Using an IDE?: No
  • OpenOCD command line: openocd -f board/esp32c3-builtin.cfg or openocd -f board/esp32c3-builtin.cfg -c "adapter_khz 3000"
  • JTAG Clock: default or 3000 khz
  • ESP-IDF version: git master

Problem Description

I tested with the 2 boards mentioned above with the same result. I will describe the output of the Liliygo here but I can provide the NodeMCU as well if necessary.

Steps to reproduce the behavior:

  1. followed the documentation to install ESP-IDF from git.
  2. built hello_world example with idf.py build
  3. connected USB cable to 5V, GND, D+ and D- pins
  4. uploaded binary with openocd -f board/esp32c3-builting.cfg -c "program_esp build/hello_world.bin 0x10000 verify exit" with no error
  5. Launch openocd for debugging with openocd -f board/esp32c3-builtin.cfg
  6. In a separate console, launch riscv32-esp-elf-gdb
  7. At the (gdb) prompt, enter target remote :3333
  8. gdb fails. See detailed logs below
Reading symbols from build/hello-world.elf...
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+

Debug Logs

gdb_log.txt

w +$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df
r +<Timeout: 2 seconds>
w -
r <Timeout: 2 seconds>
w -
r <Timeout: 2 seconds>
w -+$vMustReplyEmpty#3a
r <Timeout: 2 seconds>
w $vMustReplyEmpty#3a
r <Timeout: 2 seconds>
w $vMustReplyEmpty#3a
r <Timeout: 2 seconds>
w $vMustReplyEmpty#3a
r <Timeout: 2 seconds>+$PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+#02
w +
End of log

openocd_log.txt (too large to fit here)

Expected behavior

A functional debug prompt

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