Error: Can't find board/esp32s2.cfg in procedure 'script'

Trying to degug with the esp-prog I just rcvd in the mail. Followed a number of setup tutorials primarily the one from brian lough, 5 hours passed and still no luck. Any pointers would be highly appreciated.

my platform.io

[env:lolin_s2_mini]
platform = espressif32
board = lolin_s2_mini
;board = esp32-s2-kaluga-1
framework = arduino
upload_port = COM25
debug_tool = esp-prog
;upload_protocol = esp-prog
debug_init_break = tbreak setup
debug_speed = 200

The error I get

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-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

embedded:startup.tcl:26: Error: Can't find board/esp32s2.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 26
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: Success.

In frustration I tried another board (the one commented out above) and things were a little different

Warn : Bypassing JTAG setup events due to errors
Error: Unexpected OCD_ID = 00000000
Warn : target esp32s2 examination failed
Info : starting gdb server for esp32s2 on pipe
Info : accepting 'gdb' connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32s2:

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.





VScode Plugin is PlatformIO 6.1.7

Many thanks in advance for any pointers.

This config file indeed doesn’t exist. There’s only boards/esp32s2-bridge.cfg, boards/esp32s2-kaluga-1.cfg and target/esp32.cfg. So that’s indeed a bug in the board definition, I’ve proposed a fix in this PR.

With this board it’ll be using

source [find interface/ftdi/esp32s2_kaluga_v1.cfg]
source [find target/esp32s2.cfg]

with the very specific pinout

# interface 1 is the uart
ftdi channel 0

# TCK, TDI, TDO, TMS: ADBUS0-3
# TRST/SRST: ADBUS5 (unused for now)
# LEDs: ACBUS3-4 (inverted)

ftdi layout_init 0x0008 0x180b
ftdi layout_signal LED -ndata 0x0800
ftdi layout_signal LED2 -ndata 0x1000

looking at the ESP-PROG schematics this does look good though, the exposed FT_TCK, FT_TDI, … etc signals are on ADBUS0-3.

Can you describe the wireup between your ESP32S2 and the ESP-PROG? Is board externally powered (not by the 3.3V of the esp-prog)?

Max, thank you so much for your reply. I must say that I am new to platformio and hardware debugging, so my understanding and therfore ability to find solutions are somewhat limited. The ESP32 is connected via USB and powered via that port. The ESP-PROG is connected via USB.

The two boards are connected via jumper wires as follow

TMS -> GPIO14
TCK ->GPIO13
TDO->GPIO15
TDI->GPIO12
GND->GND

Is there a way I could define the config file myself ?

Just for clarity, I followed the steps in the following links to wire, setup drivers etc

His youtube video is here

Thanks again

Your first post talks about an ESP32S2 chip. That’s not an ESP32. The JTAG pins for an ESP32S2 chip are different, IO39 to IO42. See e.g. here.

Apologies, It is an ESP32S2 not ESP32 . Specifically it is S2 mini — WEMOS documentation
I took a look at the link and that leaves me to believe then that it is not possible to debug using this board as the IO pins 41 and 42 are not exposed ?

Yes, that’s unfortunately true. Unless you can do microsoldering those pins are not accessible and thus not debuggable.

Unfortunately an ESP32-S2 also doesn’t have built-in USB JTAG like the e.g. ESP32-C3 has.

So if you want to use hardware debug a ESP32-S2, it will have to be on a different board where all JTAG pins are accessible.

Thank you, yes I thought of doing that.Not a chance as all I have is a pinecil and even with the smallest tip would butcher that !! I want to thank you again for providing the info about the io pins on the ESP32S2 being different than on the standard ESP32