I followed all the instructions from
I feel that I’m very close but just can’t get it to debug.
I bought the esp-prog and the expressif 356-ESP32-DEVKITC32D dev kit,
I connected the 2 boards (3.3V, gnd, jtag 12,13,14,15), installed vscode and platformio.
I installed FTDI and Zadig
I connected a usb cable to the esp-prog to my computer (COM5) and a second usb cable to the esp32 to my computer on an other usb port (COM7).
I feel that I followed all the instructions but when I tried to debug, it fails to connect properly to gdb.
I’m using visual studio with platformio on windows 10.
I don’t know what else to do
I think that the debug code is not getting upload in the esp32 (Start debug compiles it in debug but then doesn’t upload it)
and then the debugger console has some issues (see logs below)
my platformio.ini has the following
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
; Serial Monitor options
monitor_speed = 115200
upload_port = COM5
debug_port = COM7
debug_tool = esp-prog
debug_init_break = tbreak setup
Here is the output of my debug console.
------------------------------------------------
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: docs.platformio /page/boards/espressif32/esp32dev
PLATFORM: Espressif 32 1.12.0 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (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)
PACKAGES:
- framework-arduinoespressif32 3.10004.200129 (1.0.4)
- tool-esptoolpy 1.20600.0 (2.6.0)
- toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder ->bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 26 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <WiFi> 1.0
Building in debug mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 11.9% (used 39064 bytes from 327680 bytes)
Flash: [===== ] 52.1% (used 683238 bytes from 1310720 bytes)
========================= [SUCCESS] Took 3.92 seconds =========================
undefinedOpen On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Detected debug stubs @ 3ffc1cb8 on core0 of target 'esp32'
Info : Listening on port 3333 for gdb connections
Reading symbols from c:\Users\vince\Documents\PlatformIO\Projects\Esp32 time\.pio\build\esp32dev\firmware.elf...
done.
PlatformIO Unified Debugger ->pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Info : xtensa_poll: Target offline
Error: xtensa_poll: Target failure
Polling target esp32 failed, trying to reexamine
Error: cpu0: esp32_fetch_all_regs (line 273): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: esp32_fetch_all_regs (line 273): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: esp32_fetch_all_regs (line 273): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Error: cpu0: esp32_fetch_all_regs (line 303): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: esp32_fetch_all_regs (line 303): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: esp32_fetch_all_regs (line 303): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Error: Exception reading pc!
Info : Target halted. PRO_CPU: PC=0x00000000 (active) APP_CPU: PC=0x00000000
Error: cpu0: xtensa_write_memory (line 807): DSR (120034E5) indicates target still busy!
Warn : esp32: Failed writing 4 bytes at address 0x3ff5f064, data - a1, 3a, d8, 50, 98, 52, 1c, 01
Error: Failed to write ESP32_TIMG0WDT_PROTECT (-4)!
Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : cpu0: Failed reading 16 bytes at address 0x3ffc1cb8
Error: Failed to read target memory (-4)!
Info : xtensa_poll: Target offline
Error: xtensa_poll: Target failure
Polling target esp32 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Error: xtensa_poll: Target failure
Polling target esp32 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Thank you
Vince