Error when debugging PlatformIO project in VSCode on MAC: 'Failed to launch GDB'

Hi all,

Trying to debug a simple blink sketch in my PlatformIO project within Visual Studio Code on my MAC (10.15) for the first time but getting following errors.

Been all over the internet but now lost and confused. Any help or links to a resolution will be greatly appreciated.

Not a MAC expert, so any Terminal commands, please tell me where to change directory (cd) to first. Thanks.

Visual Studio Code/PlatformIO Pop-Up Error

Failed to launch GDB: .pioinit:11: Error in sourced command file:
Remote connection closed (from interpreter-exec console “source .pioinit”)

Debug Consol error message

========================= [SUCCESS] Took 1.11 seconds =========================
Reading symbols from /Users/JoeBloggs/Documents/PlatformIO/Projects/AZ Delivery ESP32 DEV > Kit C V2/.pio/build/esp32dev/firmware.elf…
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : tcl server disabled
Info : telnet server disabled
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description ‘', serial '’ at bus location ‘*’
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
.pioinit:11: Error in sourced command file:
Remote connection closed

My PlatformIO.ini

platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_port = /dev/cu.SLAB_USBtoUART

OpenOCD was not able to find the external debugger device, which should contain an FTDI chipset for JTAG debugging and is supposed to be connected to your ESP32 board (see documentation).

  1. Is it connected to the Mac?
  2. If yes, have you installed libusb? (with brew and brew install libusb)

I don’t have a separate device, no.

Can ‘Visual Studio Code’ not debug the .cpp code locally isolated from the board like Visual Studio can with software applications? It’s VS debugging capability my principle reason for using VSCode.

If there is no other way, I’ll purchase a debugging device, install the drivers and try again. Or just use logging.

For local software applications, the program is running on your computer locally so it’s easably debuggable to see what’s going on in your local CPU.

Since the firmware is running on an external CPU (the XTensa Tensilica LX7 of the ESP32), there needs to be some kind of connection and communication to see the internal CPU state, set breakpoints and see memory et cetera. That connection is usually JTAG and it needs a debugger to communicate over that protocol.

See for debugging devices and setup. An esp-prog doesn’t cost much.

Thats bridged my understanding. Thanks very much!