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

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 v1.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 v1.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.

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
1 Like

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.

1 Like

Ok, I checked the wiring.
DevKit


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.

I had similar issues with ESP32-S3-devkitC (JTAG scan: all zeros).
After spending many hours I eventually find out that I needed to set a fuse in order to use the JTAG interface over pins 39-42.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/configure-other-jtag.html
Install python, run cmd and type something like

python espefuse.py --baud 115200 --port COM25 burn_fuse STRAP_JTAG_SEL

As far as I read setting this fuse cannot be undone, so do it with care.
Posting in case others have same issue.

4 Likes

I had all sorts of issues trying to use the internal JTAG featured in the ESP32-S3-DevKitC1 V1.1 so I thought I would try my ESP-TOOL wired as the OP sorted out, which is how I found myself here in this thread. Reading your link about the fuse, it looks as though the switch is as you said, permanent. But if STRAP_JTAG_SEL is burned instead, internal JTAG use can still be used by tying GPIO3 to HIGH will still enable the internal JTAG feature. Tying GPIO3 to LOW enables external JTAG pins GPIO39 through GPIO-42. Can anyone confirm this? And will burning STRAP_JTAG_SEL work if the eFuse DIS_USB_JTAG is left alone?

  • Burning DIS_USB_JTAG eFuse will permanently disable the connection between USB_SERIAL_JTAG and the JTAG port of the ESP32-S3. JTAG interface can then be connected to GPIO39-GPIO42. Note that USB CDC functionality of USB_SERIAL_JTAG will still be usable, i.e., flashing and monitoring over USB CDC will still work.
  • Burning STRAP_JTAG_SEL eFuse will enable selection of JTAG interface by a strapping pin, GPIO3. If the strapping pin is low when ESP32-S3 is reset, JTAG interface will use GPIO39-GPIO42. If the strapping pin is high, USB_SERIAL_JTAG will be used as the JTAG interface.

EDIT: I found the answer in this thread… ESP32-S3 GPIO3 does not select external JTAG when low - ESP32 Forum. If DIS_USB_JTAG is left alone and STRAP_JTAG_SEL is burned, you still have the option to switch between external or internal JTAG debugging by changing the state of GPIO3. AWESOME!

I am having similar problems with esp32-s3-devkitc-1

I’ve put in my obligatory four days working on this (refer to the four days it took in 1966 to load 5MB of data using punch cards… [1966 5mb 4 days] )(Redirecting...)
and still getting nowhere…

I have burned the DIS_USB_JTAG efuse and am 100% confident of the pinout and wiring.

Not sure what to do about

undefinedC:\Users\peted\.platformio\packages\toolchain-xtensa-esp32s3@8.4.0+2021r2-patch5\bin\xtensa-esp32s3-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory."

and the rest of the error messages…

Warn : target esp32s3.cpu0 examination failed

Error: Unexpected OCD_ID = ffffffff

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.