Debugger help with using the VCP FTDR driver on MacOS Monterey

Went to the FTDI website and downloaded the VCP driver.

Mac OS X10.15 and macOS 11/12 2021-05-18 1.4.7 This is a Beta driver release and the installer should be run from the Applications folder on your machine

Ran the installer from the App directory and enabled the extension. Pressed "Install FTDI USB Serial Dext VCP and App says: Succeeded.

When I try to use the driver in the IDE; I get the following from the debug window:

Reading symbols from /Users/donaldhewitt/Documents/PlatformIO/Projects/pir_relay_example/.pio/build/az-delivery-devkit-v4/firmware.elf…
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.10.0-esp32-20210721 (2021-07-21-13:34)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_claim_interface() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with vid 0403, pid 6010, description ‘', serial '’ at bus location ‘
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '
’, serial ‘’ at bus location '

Assertion failed: (jtag_trst == 0), function jtag_checks, file …/src/jtag/core.c, line 343.
.pioinit:11: Error in sourced command file:
Remote connection closed

Please let me know what I am doing wrong.

Thanks,

Don

Can you check in some system control panel what the USB VID + PID of the connected ESP-Prog device is?

When I click on “Devices” I get

/dev/cu.usbserial-14501 Dual RS232-HS USB VID:PID=0403:6010 LOCATION=20-5
/dev/cu.usbserial-14500 Dual RS232-HS USB VID:PID=0403:6010 LOCATION=20-5
/dev/cu.usbserial-7 Dual RS232-HS USB VID:PID=0403:6010 LOCATION=20-5
/dev/cu.usbserial-8 Dual RS232-HS USB VID:PID=0403:6010 LOCATION=20-5

Now there might a conflict with the apple driver? See Unable to claim USB interface with C + libusb on Mac OS X - Stack Overflow

Also maybe @manuelbl has more ideas.

When I check “About this Mac” → System Report → USB; i get:

USB 3.0 Bus:

Host Controller Driver: AppleUSBXHCISPT
PCI Device ID: 0xa12f
PCI Revision ID: 0x0031
PCI Vendor ID: 0x8086

Apple T1 Controller:

Product ID: 0x8600
Vendor ID: 0x05ac (Apple Inc.)
Version: 1.01
Manufacturer: Apple Inc.
Location ID: 0x14200000

USB 3.1 Bus:

Host Controller Driver: AppleUSBXHCIAR
PCI Device ID: 0x15d4
PCI Revision ID: 0x0002
PCI Vendor ID: 0x8086
Bus Number: 0x01

Maybe Low-cost ESP32 In-circuit Debugging | by Manuel Bl. | Medium is still valid in regards to this and you have to do a

sudo kextunload /Library/Extensions/FTDIUSBSerialDriver.kext

instead?

I did as you suggested and got the following error:

Executing: /usr/bin/kmutil unload -p /Library/Extensions/FTDIUSBSerialDriver.kext

Error Domain=KMErrorDomain Code=71 “Kernel request failed: (libkern/kext) not found (-603947002)” UserInfo={NSLocalizedDescription=Kernel request failed: (libkern/kext) not found (-603947002)}

This very much indicates that you have duplicate drivers installed. They are in conflict. You should only get two entries.

MacOS has FTDI drivers out of the box (provided by Apple). Please uninstall all FTDI software.

I have uninstalled the FTDI software. When I connect the ESP-Prog to one of my USB ports; I get two instances of the usbserial port:

  • /dev/cu.usbserial-14100
  • /dev/cu.usbserial-14101

When I connect the ESP32 devkit board; I get two additional ports:

  • /dev/cu.usbserial-0001
  • /dev/cu.SLAB_USBtoUART

I can reliably upload from "/dev/cu.SLAB_USBtoUART; but not from
/dev/cu.usbserial-0001

Still not able to debug. Not sure where to go from here

Also; I removed the FTDI software in “/Local/Extensions/”.

Don

This also looks like duplicate drivers, this time for the CH340G chip. Again, remove any third-party drivers as MacOS has suitable Apple drivers out-of-the-box. Or leave it alone as /dev/cu.SLAB_USBtoUART is working.

For upload, you now have two options:

  • useesp_tool through /dev/cu.SLAB_USBtoUART
  • use JTAG through ESP-Prog. (It’s not actually using /dev/cu.usbserial-14501 as it doesn’t use the serial protocol.)

Test the latter one by configuring it like so:

upload_protocol = esp-prog

If that works, debugging is also very likely to work.

1 Like

thanks,

Just to make sure. I need to use the ESP-Prog to upload to the ESP32 and to connect to the JTAG ports? So; I will just have one serial cable from the MBP to the ESP-Prog?

I’m assuming you have an ESP32 development board with a USB connector that serves both to supply power and for serial communication as well as the ESP-Prog adapter.

If you just want to upload firmware, ESP-Prog is not needed. You can directly upload via the serial connection. But if you are preparing the setup for debugging, you have the option to also upload via JTAG (using ESP-Prog). This option is helpful for figuring out if the JTAG interface is working.

If you use ESP-Prog, you still need to provide power via the USB connector to the development board, be it from your MacBook or from some USB power supply.

Got it to work. I used the esp-prog for both upload and jtag. I will play around with setting breakpoints and examining variables next. Quite a hurdle with MacOS.

On MacOS, it’s actually the easiest: no driver installation, no permission configuration, no nothing. You just got off on the wrong foot by installing unnecessary drivers (old Windows habit?).

On Windows, you need to download Zadig and switch the drivers because Windows has a very rigid driver model for USB.

On Linux, you need to modify configuration responsible for managing access rights for USB devices.