Could not open connection to FTDI device

I am working on a small OS X application that connects to an FTDI device. I configured my project according to the answer in this question (I added the .dylib file as a framework, and I added ftd2xx.h, WinTypes.h and ftd2xx.cfg to my project).

Currently, I can determine if the FTDI device is / is connected via USB:

DWORD deviceCount = 0; FT_STATUS ftdiPortStatus = FT_ListDevices(&deviceCount, NULL, FT_LIST_NUMBER_ONLY) if (ftdiPortStatus == FT_OK) { // The debugger tells me the deviceCount is now 1 ... } 

However, if I try to open a connection to the device using one of the following methods:

 ftdiPortStatus = FT_OpenEx("FT232R USB UART",FT_OPEN_BY_DESCRIPTION,deviceHandle); // OR ftdiPortStatus = FT_Open(0, deviceHandle); 

the returned ftdiPortStatus is always 3 (FT_DEVICE_NOT_OPENED).

The answer here indicates that the problem may be the new driver that Apple added in OSX 10.9, however, if I try to unload this kext:

 sudo kextunload -b com.apple.driver.AppleUSBFTDI 

The OS indicates that no such kext was found. I'm on OSX 10.10, so maybe Apple repents of its ways and removes this driver from Yosemite (?) In any case, I still can’t connect ... Does anyone know what might interfere with the connection or ideas about how can I track the problem (returned FT_STATUS is not very useful ...)?


UPDATE :
The answer below solved the problem for me. If you do not know if you have a second VGA driver other than Apple, you can find other drivers by running the following command in the terminal:

 kextstat | grep FTDI 

which will output something like this:

  154 0 0xffffff7f831ee000 0x8000 0x8000 com.FTDI.driver.FTDIUSBSerialDriver (2.2.18) <96 16 5 4 3 1> 155 0 0xffffff7f831f6000 0x7000 0x7000 com.apple.driver.AppleUSBFTDI (1.0.1b12) <96 16 5 4 3> 
0
source share
1 answer

No, this driver is still located in Yosemite. Performance

 sudo kextunload -b com.apple.driver.AppleUSBFTDI 

still deletes the corresponding kext and frees the device for access through the D2XX library on this Yosemite system that I just tested. Kext may be missing if you have not yet connected your FTDI device to the system.

It can also be blocked by another virtual communication port driver. If you installed the driver of the virtual communicator FTDI, which will also control the port and block the D2XX library from connecting. Some Arduino dev kits also use virtual communication port drivers for their FTDI chips, so they can install their own driver. Check this.

Finally, the device name β€œFT232R USB UART” that I use in my sample code may not be the name of your device. There are many options for FTDI, and you will need to make sure that you use the name of your device type. This can be obtained from the FT_ListDevices() command with the FT_LIST_BY_INDEX|FT_OPEN_BY_DESCRIPTION . If you use the wrong device name, FT_OpenEx() may fail.

+3
source

All Articles