failed to launch GDB.pioinit:11: Error sourced command file: Remote communication error. Target disconnected.: Success. (from interpreter-exec console)

Hello, while debugging an ESP32 S3 or Sparkfun ESP32 S2 Thing Plus in PlatformIO, the following error keeps occurring: "failed to launch GDB.pioinit:11: Error sourced command file: Remote communication error. Target disconnected.: Success. (from interpreter-exec console). Can someone help me with this problem, please?

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: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Error: unable to find a matching CMSIS-DAP device
.pioinit:11: Error in sourced command file:
undefinedException in callback DebugSubprocessProtocol.pipe_data_received(1, bytearray(b'&...ile:\\n"\r\n'))
handle: <Handle DebugSubprocessProtocol.pipe_data_received(1, bytearray(b'&...ile:\\n"\r\n'))>
Traceback (most recent call last):

For the ESP32-S2, you will need an external JTAG adapter such as a J-Link, ESP-PROG or FT232H or similiar, since it does not have a builtin USB-JTAG controller. (See e.g. https://learn.adafruit.com/adafruit-metro-esp32-s2/debugging-with-openocd and the JTAG connector in the schematics).

The ESP32-S3 on the other hand does have a USB-JTAG controller built in, so conveniently only a USB cable is needed (source). However, you have to make sure that the USB port on your ESP32-S3 dev board actually goes to the ESP32-S3 chip itself, not e.g. some USB-to-UART adapter. Since you didn’t exactly say which board you have and how you’ve configured it, it’s hard to so much more.

Hello Max,
thank you for your response. I have ESP Prog as a debug tool (JTAG adapter). My board is from SparkFun with the ESP32-S2 chip (SparkFun ESP32-S2 Thing Plus) and it has a debug point to connenct. I have already downloaded the driver and installed it via Zadig, but unfortunately, the same error keeps occurring. I have repeated the installation a few times, but it didn’t help.

and this is the configuration ( platformio.ini):

[env:sparkfun_esp32s2_thing_plus]
platform = espressif32
board = sparkfun_esp32s2_thing_plus
framework = arduino

#build_type=debug
debug_tool =esp-prog
upload_speed=115200
debug_init_break = tbreak setup


lib_deps =
  adafruit/Adafruit BNO055 @ ^1.6.3
  adafruit/Adafruit BusIO @ ^1.14.5
  Wire
  SPI
  adafruit/Adafruit Unified Sensor @ ^1.1.14

Then what’s the exact output of the debug task? The one you’ve posted talks about not finding a CMSIS-DAP, which can’t possibly happen if you selected debug_tool = esp-prog, since that’s FTDI based. Also, a picture of your wiring setup between the ESP-PROG and the target board would be nice for inspection.