Finally Working : ESP32 debugging on a Mac (with esp-wrover-kit)

It took me some hours (better day) to make it work,
But finally I got it working:

ESP32 debugging in PlatformIO in Visual Studio Code on my Mac (with the esp-wrover-kit)

This is my platform.ini file:

[env:esp-wrover-kit]
; platform = espressif32 ;as of 5.8.2018 this is not yet integrated in the PIO release version
platform = GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO

framework = arduino
board = esp-wrover-kit
monitor_speed = 115200
upload_port = /dev/cu.usbserial-14601

debug_tool = ftdi


SideNotes:
A “LIBUSB_ERROR_ACCESS” while initialising the FTDI drove me nuts:
Error: libusb_claim_interface() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with vid 0403, pid 6010, description ‘’ and serial '

There a many useless explanations about loading & unloading Apple & FTDI serial drivers…

The solution was to UNISTALL (yes: remove!) the FTDI driver on MacOS 10.13.X (High Sierra)

cd /Library/Extensions
sudo rm -r FTDIUSBSerialDriver.kext

This hints helped a lot:
- https://www.youtube.com/watch?v=e9sc72x59cQ
- and the “FTDI Drivers Installation Guide for MAC OSX” page 16

Thanks @ the PlatformIO team
I hope this will help others as well,

AJ

Thank you so much! We have just updated our docs. See “Drivers” in FTDI Chip — PlatformIO latest documentation

I run in the same problem, i’ve done exactly as you did, removed the file as root and reboot but i get the same error again. Lost so much time already, does somebody has an idea ?

So which Mac OS version are you using?

im using macos 10.14

So you have tried with both the MacOS supplied driver and the FTDTI supplied driver and the behaviour is the same?

yes exactly, i tried both

Same for me I use 10.14.3

regards,
rob

Debugging does work on my Mac (10.14.4 Mojave) using the information in the original post (although now simply platform = espressif32 is sufficient). Be sure to put jumpers across the four JTAG-enable pin pairs as described in the ESP32-WROVER-KIT Getting Started Guide (https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html). Make sure the FTDI vendor-supplied drivers are not installed and just reply on the Apple built-in driver, and look for the correct value in /dev/cu.usbserial-???.

I spent a lot of time trying to get this working because I’d missed the step about installing the JTAG-enable jumpers and ended up writing a script to prevent mapping of the first FTDI interface to a serial /dev entry. It’s actually not necessary to use it but in case it’s useful to someone it can be found here: Script to prevent loading of the Apple USB FTDI interface 0 driver on Mac OS X · GitHub

1 Like

This worked precisely once for me after deleting the FTDI driver, but then never again. Can anyone suggest what I might be doing wrong?

It’s a WROVER-KIT as delivered but with the four JTAG jumpers connected. It worked the very first time, I could single-step code, but then never have been able to restart the debugger. From a fresh boot, the output is:

Reading symbols from firmware.elf…
done.
PlatformIO Unified Debugger > Redirecting...
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.10.0-esp32-20190313 (2019-03-13-09:59)
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
Info : ftdi: if you experience problems at higher adapter clocks, try the command “ftdi_tdo_sample_edge falling”
Info : clock speed 20000 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: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : accepting ‘gdb’ connection from pipe
Error: No symbols for FreeRTOS
Error: Target not examined yet

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
Ignoring packet error, continuing…
warning: unrecognized item “timeout” in “qSupported” response

Could you try to reconnect device from USB and reflash with any “blink” firmware? Try debugging now.