PlatformIO Community

Debugging - esp32-s3-devkitc-1 and ESP-PROG

I’m attempting to set up debugging with an EspressIf ESP32-S3- DevKitC-1 and an EspressIF ESP-Prog. Short description - builds and loads fine, fails to debug - first error: JTAG scan chain interrogation failed: all zeroes

Details -
Windows 10Pro – 8gb
VS Code version 1.68.1 6/14/2022

Platformio.ini
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
debug_tool = esp-prog
build_type = debug
debug_init_break = tbreak setup

Ran Zadig
Dual RS232-HS
CP2102N

Have two USB connections.
First is from CP2012N USB port to DevKit board. Plugged into the UART (not USB) port on DevKit board.

Second is from RS232-HS to ESP-Prog

ESP-Prog wiring TMS			GPIO 14	DevKit
                TCK			GPIO 13
                TDO			GPIO 15
                TDI			GPIO 12

DevKit

ESP-Prog

Using ‘Scan Wifi’ example. Compiles fine, loads fine, console monitor shows looping statements and identified networks.

Build

Processing esp32-s3-devkitc-1 (platform: espressif32; board: esp32-s3-devkitc-1; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html
PLATFORM: Espressif 32 (4.4.0) > Espressif ESP32-S3-DevKitC-1
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (cmsis-dap, 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.20003.220613 (2.0.3)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- WiFi @ 2.0.0
Building in debug mode
Retrieving maximum program size .pio\build\esp32-s3-devkitc-1\firmware.elf
Checking size .pio\build\esp32-s3-devkitc-1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  11.3% (used 37152 bytes from 327680 bytes)
Flash: [=====     ]  45.2% (used 592849 bytes from 1310720 bytes)
=============================================================================== [SUCCESS] Took 9.02 seconds

Debug console

undefinedC:\Users\Greg\.platformio\packages\toolchain-xtensa-esp32s3\bin\xtensa-esp32s3-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory. 
Reading symbols from c:\Users\Greg\Documents\PlatformIO\Projects\devkit-1\.pio\build\esp32-s3-devkitc-1\firmware.elf... 
PlatformIO Unified Debugger -> https://bit.ly/pio-debug 
PlatformIO: debug_tool = esp-prog 
PlatformIO: Initializing remote target... 
Open On-Chip Debugger v0.11.0-esp32-20220411 (2022-04-11-08:48) 
Licensed under GNU GPL v2 
For bug reports, read 
http://openocd.org/doc/doxygen/bugs.html 
adapter speed: 20000 kHz 
DEPRECATED! use 'adapter speed' not 'adapter_khz' 
adapter speed: 5000 kHz 
Info : tcl server disabled 
Info : telnet server disabled 
Info : clock speed 5000 kHz 
Error: JTAG scan chain interrogation failed: all zeroes 
Error: Check JTAG interface, timings, target power, etc. 
Error: Trying to use configured scan chain anyway... 
Error: esp32s3.cpu0: IR capture error; saw 0x00 not 0x01 
Warn : Bypassing JTAG setup events due to errors 
Warn : target esp32s3.cpu0 examination failed 
Warn : target esp32s3.cpu1 examination failed 
Info : starting gdb server for esp32s3.cpu0 on pipe 
Info : accepting 'gdb' connection from pipe 
Error: Target not examined yet 
Error executing event gdb-attach on target esp32s3.cpu0: 
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 
Error: error during select: Unknown error 
.pioinit:11: Error in sourced command file: 
Remote communication error. Target disconnected.: Success.

Any advice or troubleshooting steps would be greatly appreciated.
Thanks.

Per ESP32-S3-DevKitC-1 - ESP32-S3 - — ESP-IDF Programming Guide latest documentation this is wrong for a ESP32-S3 chip. These look like the regular ESP32 JTAG pins to me.

Correct per that documentation is

ESP-Prog wiring TMS			GPIO 42 DevKit
                TCK			GPIO 39
                TDO			GPIO 40
                TDI			GPIO 41

Also refer to the nice pin layout picture for the board for the JTAG pins: ESP32-S3-DevKitC-1 - ESP32-S3 - — ESP-IDF Programming Guide latest documentation

Thanks for the reply. I had found the pin layout, but didn’t know quite how to read it.

I rewired, and it still fails. Checked it 5+ times.

newpins

Hopefully you can see the colors.

Here’s the debug console

undefinedC:\Users\Greg\.platformio\packages\toolchain-xtensa-esp32s3\bin\xtensa-esp32s3-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from c:\Users\Greg\Documents\PlatformIO\Projects\devkit-1\.pio\build\esp32-s3-devkitc-1\firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220411 (2022-04-11-08:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 5000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32s3.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32s3.cpu0 examination failed
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32s3.cpu0:

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
Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: Success.

Any thoughts?

The connections look to be in the right place by my observation

  1. Flux can be conductive, I would clean that with isopropyl alcohol from the board
  2. Try setting debug_speed = 500 in the platformio.ini to lower the debug speed (connecting high speed signals onto a breadboard is bad)
  3. Upload a more simple blink example first, but make sure that none of the GPIO pins for JTAG are used for it

Assuming that the firmware you have uploaded to the ESP32 does not configure pins 39 to 42 in any way and does not use deep sleep, the problem is in the wiring between the ESP-Prog and the ESP32 dev board.

The hint is the error message:

Check, re-check and measure the connections.

Ok, I checked the wiring.
DevKit
devkit
Esp-prog
esp-prog
You should be able to see the colors and verify the connections.

My original connection was composed of 2 wires - an 8" female-to-female and a 4" male-to-male. I replaced them with 8" female-to-male. Is this considered too long?

Still getting the same error:

Info : clock speed 5000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32s3.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors

I cleaned the flux (I think) - isopropyl 91 and cotton swabs - man was that interesting.

I added the debug_speed

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
debug_tool = esp-prog
build_type = debug
debug_init_break = tbreak setup
debug_speed = 500

Now I get

undefinedC:\Users\Greg\.platformio\packages\toolchain-xtensa-esp32s3\bin\xtensa-esp32s3-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from c:\Users\Greg\Documents\PlatformIO\Projects\devkit-1\.pio\build\esp32-s3-devkitc-1\firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.11.0-esp32-20220411 (2022-04-11-08:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 500 kHz

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 500 kHz
Info : TAP esp32s3.cpu0 does not have valid IDCODE (idcode=0x0)
Info : TAP esp32s3.cpu1 does not have valid IDCODE (idcode=0x0)
Info : TAP auto0.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto1.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto2.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto3.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto4.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto5.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto6.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto7.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto8.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto9.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto10.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto11.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto12.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto13.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto14.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto15.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto16.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto17.tap does not have valid IDCODE (idcode=0x0)
Info : TAP auto18.tap does not have valid IDCODE (idcode=0x0)
Warn : Unexpected idcode after end of chain: 21 0x00000000
Warn : Unexpected idcode after end of chain: 53 0x00000000
Warn : Unexpected idcode after end of chain: 85 0xff800000
Error: double-check your JTAG setup (interface, speed, ...)
Error: Trying to use configured scan chain anyway...
Error: esp32s3.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32s3.cpu0 examination failed
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32s3.cpu0:

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
Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: Success.

Thoughts?

It still looks like a wiring problem. One or more of the cables is likely not making good contact. Make sure all cables are properly seated by pushing down the wires instead of the connector housing and verify it with a multi-meter.

Other users had had exactly the same problem (TAP esp32s3.cpu0 does not have valid IDCODE (idcode=0x0)) when TDI did not make contact.

I can also recommmend using short female to female jumper cables that go directly from the ESP-Prog into the development, without the breadboard.