2

I am working with a lot of FTDI usb to serial chips integrated in various devices. I have to use the genuine FTDI driver as the newly integrated AppleFTDI Driver is less general and does not recognize some of the devices I work with while the FTDI driver do. Technically, this should not be an issue as the AppleFTDI driver should have a lower priority and let the FTDI driver take control of the devices.

However, recently (since Mojave I think), if a USB to Serial converter is connected to the computer before it is turned on, it cannot be opened at startup. It still is correctly identified and a BSD path is created, but when I try to open a connection, it fails, saying that the ressource is busy. If the device is unplugged and plugged back in, the error vanishes and the port can be opened correctly. I looked at the ioreg and effectively, at startup, it seems that the AppleFTDI is taking control of the device and creates the BSD Path (which is not supposed to happen), but not after unplugging and plugging back the converter, in which case it is the FTDI driver that takes control :

Last login: Wed Jun  5 07:56:09 on console

//AT STARTUP : two instances interact with the device (identified as FT232R USB UART) : the port is busy and no connection can be established
bertrands-imac:~ bertrandded$ ioreg | grep -C 10 FTDI
    | |   |   |   +-o IOUSBHostInterface@1  <class IOUSBHostInterface, id 0x10000043d, !registered, !matched, active, busy 0, retain 5>
    | |   |   |   +-o IOUSBHostInterface@2  <class IOUSBHostInterface, id 0x10000043e, !registered, !matched, active, busy 0, retain 10>
    | |   |   |   +-o IOUSBHostInterface@3  <class IOUSBHostInterface, id 0x10000043f, !registered, !matched, active, busy 0, retain 7>
    | |   |   |   +-o IOUSBHostInterface@4  <class IOUSBHostInterface, id 0x100000440, !registered, !matched, active, busy 0, retain 5>
    | |   |   |   +-o IOUSBHostInterface@5  <class IOUSBHostInterface, id 0x100000441, !registered, !matched, active, busy 0, retain 5>
    | |   |   +-o HS10@14600000  <class AppleUSB20XHCIPort, id 0x1000002e5, registered, matched, active, busy 0 (12 ms), retain 15>
    | |   |   | +-o FT232R USB UART@14600000  <class IOUSBHostDevice, id 0x10000031b, registered, matched, active, busy 0 (12 ms), retain 23>
    | |   |   |   +-o AppleUSBHostLegacyClient  <class AppleUSBHostLegacyClient, id 0x100000327, !registered, !matched, active, busy 0, retain 10>
    | |   |   |   +-o AppleUSBHostCompositeDevice  <class AppleUSBHostCompositeDevice, id 0x100000331, !registered, !matched, active, busy 0, retain 4>
    | |   |   |   +-o FT232R USB UART@0  <class IOUSBHostInterface, id 0x100000333, registered, matched, active, busy 0 (9 ms), retain 10>
    | |   |   |     +-o AppleUSBFTDI  <class AppleUSBFTDI, id 0x1000003ab, registered, matched, active, busy 0 (4 ms), retain 6>
    | |   |   |       +-o IOSerialBSDClient  <class IOSerialBSDClient, id 0x1000003b0, registered, matched, active, busy 0 (0 ms), retain 5>
    | |   |   +-o HS13@14700000  <class AppleUSB20XHCITypeCPort, id 0x1000002e8, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |   +-o HS14@14800000  <class AppleUSB20XHCITypeCPort, id 0x1000002e9, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |   +-o SS02@14900000  <class AppleUSB30XHCIPort, id 0x1000002ea, registered, matched, active, busy 0 (0 ms), retain 14>
    | |   |   +-o SS04@14a00000  <class AppleUSB30XHCIPort, id 0x1000002eb, registered, matched, active, busy 0 (0 ms), retain 14>
    | |   |   +-o SS05@14b00000  <class AppleUSB30XHCIPort, id 0x1000002ec, registered, matched, active, busy 0 (0 ms), retain 16>
    | |   |   +-o SS06@14c00000  <class AppleUSB30XHCIPort, id 0x1000002ed, registered, matched, active, busy 0 (0 ms), retain 16>
    | |   +-o IMEI@16  <class IOPCIDevice, id 0x1000001cb, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   | +-o AppleIntelMEIDriver  <class AppleIntelMEIDriver, id 0x100000448, registered, matched, active, busy 0 (0 ms), retain 8>
    | |   +-o SATA@17  <class IOPCIDevice, id 0x1000001cc, registered, matched, active, busy 0 (423 ms), retain 12>
--
--
      +-o IOHDIXController  <class IOHDIXController, id 0x100000123, registered, matched, active, busy 0 (0 ms), retain 5>
      +-o AppleUSBHostResources  <class AppleUSBHostResources, id 0x100000240, registered, matched, active, busy 0 (1782 ms), retain 27>
      | +-o AppleUSBLegacyRoot  <class AppleUSBLegacyRoot, id 0x100000245, registered, matched, active, busy 0 (1781 ms), retain 18>
      | | +-o AppleUSBXHCI@14000000  <class AppleUSBController, id 0x10000031d, registered, matched, active, busy 0 (1781 ms), retain 15>
      | |   +-o AppleUSBXHCI Root Hub Simulation@14000000  <class AppleUSBRootHubDevice, id 0x10000031e, registered, matched, active, busy 0 (0 ms), retain 12>
      | |   +-o Magic Keyboard with Numeric Keypad@14300000  <class AppleUSBDevice, id 0x100000320, registered, matched, active, busy 0 (0 ms), retain 13>
      | |   | +-o Device Management@0  <class AppleUSBInterface, id 0x10000032f, registered, matched, active, busy 0 (0 ms), retain 5>
      | |   | +-o Keyboard / Boot@1  <class AppleUSBInterface, id 0x100000330, registered, matched, active, busy 0 (0 ms), retain 5>
      | |   +-o FT232R USB UART@14600000  <class AppleUSBDevice, id 0x100000326, registered, matched, active, busy 0 (1779 ms), retain 14>
      | |   | +-o FT232R USB UART@0  <class AppleUSBInterface, id 0x100000334, registered, matched, active, busy 0 (1778 ms), retain 10>
      | |   |   +-o FTDIUSBSerialDriver  <class FTDIUSBSerialDriver, id 0x100000459, registered, matched, active, busy 0 (0 ms), retain 7>
      | |   |     +-o IORS232SerialStreamSync  <class IORS232SerialStreamSync, id 0x10000045a, registered, matched, active, busy 0 (0 ms), retain 5>
      | |   +-o FaceTime HD Camera (Built-in)@14400000  <class AppleUSBDevice, id 0x100000340, registered, matched, active, busy 0 (0 ms), retain 19>
      | |   | +-o FaceTime HD Camera (Built-in)@0  <class AppleUSBInterface, id 0x10000034e, registered, matched, active, busy 0 (0 ms), retain 8>
      | |   | | +-o VDCAssistant  <class IOUSBInterfaceUserClientV3, id 0x1000005d3, !registered, !matched, active, busy 0, retain 6>
      | |   | +-o AppleUSBInterface@1  <class AppleUSBInterface, id 0x10000034f, registered, matched, active, busy 0 (0 ms), retain 8>
      | |   | | +-o VDCAssistant  <class IOUSBInterfaceUserClientV3, id 0x1000005d4, !registered, !matched, active, busy 0, retain 6>
      | |   | +-o AppleUSBInterface@2  <class AppleUSBInterface, id 0x100000350, registered, matched, active, busy 0 (0 ms), retain 5>
      | |   | +-o VDCAssistant  <class IOUSBDeviceUserClientV2, id 0x1000005d2, !registered, !matched, active, busy 0, retain 5>
      | |   +-o Bluetooth USB Host Controller@14500000  <class AppleUSBDevice, id 0x100000430, registered, matched, active, busy 0 (0 ms), retain 21>
      | |     +-o AppleUSBInterface@0  <class AppleUSBInterface, id 0x100000442, !registered, !matched, active, busy 0, retain 4>

//AFTER UNPLUGGING THE DEVICE : nothing (obviously)
bertrands-imac:~ bertrandded$ ioreg | grep -C 10 FTDI

//AFTER PLUGGING IT BACK IN : only the FTDI driver instance is present : the port works fine and a connection can be established
bertrands-imac:~ bertrandded$ ioreg | grep -C 10 FTDI
      | |   | +-o VDCAssistant  <class IOUSBDeviceUserClientV2, id 0x1000005d2, !registered, !matched, active, busy 0, retain 5>
      | |   +-o Bluetooth USB Host Controller@14500000  <class AppleUSBDevice, id 0x100000430, registered, matched, active, busy 0 (0 ms), retain 21>
      | |   | +-o AppleUSBInterface@0  <class AppleUSBInterface, id 0x100000442, !registered, !matched, active, busy 0, retain 4>
      | |   | +-o AppleUSBInterface@1  <class AppleUSBInterface, id 0x100000443, !registered, !matched, active, busy 0, retain 4>
      | |   | +-o AppleUSBInterface@2  <class AppleUSBInterface, id 0x100000444, !registered, !matched, active, busy 0, retain 4>
      | |   | +-o AppleUSBInterface@3  <class AppleUSBInterface, id 0x100000445, !registered, !matched, active, busy 0, retain 4>
      | |   | +-o AppleUSBInterface@4  <class AppleUSBInterface, id 0x100000446, !registered, !matched, active, busy 0, retain 4>
      | |   | +-o AppleUSBInterface@5  <class AppleUSBInterface, id 0x100000447, !registered, !matched, active, busy 0, retain 4>
      | |   +-o FT232R USB UART@14200000  <class AppleUSBDevice, id 0x100000661, registered, matched, active, busy 0 (1006 ms), retain 14>
      | |     +-o FT232R USB UART@0  <class AppleUSBInterface, id 0x10000066b, registered, matched, active, busy 0 (1005 ms), retain 10>
      | |       +-o FTDIUSBSerialDriver  <class FTDIUSBSerialDriver, id 0x10000066c, registered, matched, active, busy 0 (0 ms), retain 7>
      | |         +-o IORS232SerialStreamSync  <class IORS232SerialStreamSync, id 0x10000066d, registered, matched, active, busy 0 (0 ms), retain 6>
      | |           +-o IOSerialBSDClient  <class IOSerialBSDClient, id 0x10000066e, registered, matched, active, busy 0 (0 ms), retain 5>
      | +-o AppleUSBHostPacketFilterService  <class AppleUSBHostPacketFilterService, id 0x100000247, !registered, !matched, active, busy 0, retain 4>
      +-o IONetworkStack  <class IONetworkStack, id 0x1000002c1, registered, matched, active, busy 0 (0 ms), retain 14>
      | +-o IONetworkStackUserClient  <class IONetworkStackUserClient, id 0x100000373, !registered, !matched, active, busy 0, retain 5>
      +-o AppleMobileFileIntegrity  <class AppleMobileFileIntegrity, id 0x1000002c2, registered, matched, active, busy 0 (0 ms), retain 7>
      +-o AppleSystemPolicy  <class AppleSystemPolicy, id 0x1000002c3, registered, matched, active, busy 0 (0 ms), retain 6>
      | +-o AppleSystemPolicyUserClient  <class AppleSystemPolicyUserClient, id 0x100000391, !registered, !matched, active, busy 0, retain 5>
      +-o IOHIDResource  <class IOHIDResource, id 0x1000002c4, registered, matched, active, busy 0 (0 ms), retain 5>
      +-o IOHIDSystem  <class IOHIDSystem, id 0x1000002c5, registered, matched, active, busy 0 (0 ms), retain 14>
bertrands-imac:~ bertrandded$ 

So, my interpretation is that, at startup, the AppleFTDI driver takes control of the device and creates the BSD Path, even if it is not supposed to, then interacts weirdly with the FTDI driver, making the port busy.

If it can help, I have looked at the ioreg tree for the AppleFTDI driver part, here is a summary (the BSDPath is the very last line) :

+-o Root  <class IORegistryEntry, id 0x100000100, retain 15>
  +-o iMac18,3  <class IOPlatformExpertDevice, id 0x100000117, registered, matched, active, busy 0 (7969 ms), retain 39>
    +-o AppleACPIPlatformExpert  <class AppleACPIPlatformExpert, id 0x100000118, registered, matched, active, busy 0 (1609 ms), retain 38>
    | +-o IOPMrootDomain  <class IOPMrootDomain, id 0x10000011b, registered, matched, active, busy 0 (105 ms), retain 82>
    | | +-o IORootParent  <class IORootParent, id 0x10000011c, !registered, !matched, active, busy 0, retain 7>
    | | +-o […]
    | +-o IOPCIMessagedInterruptController  <class IOPCIMessagedInterruptController, id 0x100000125, registered, matched, active, busy 0 (1 ms), retain 7>
    | +-o AppleVTD  <class AppleVTD, id 0x100000126, registered, matched, active, busy 0 (0 ms), retain 400>
    | +-o cpus  <class IOPlatformDevice, id 0x100000127, registered, matched, active, busy 0 (0 ms), retain 14>
    | +-o CPU0@0  <class IOACPIPlatformDevice, id 0x100000128, registered, matched, active, busy 0 (939 ms), retain 8>
    | | +-o AppleACPICPU  <class AppleACPICPU, id 0x100000131, registered, matched, active, busy 0 (852 ms), retain 8>
    | |   +-o AppleACPICPUInterruptController  <class AppleACPICPUInterruptController, id 0x100000139, registered, matched, active, busy 0 (0 ms), retain 6>
    | |   +-o X86PlatformPlugin  <class X86PlatformPlugin, id 0x1000003a7, registered, matched, active, busy 0 (832 ms), retain 12>
    | |     +-o IOPlatformEnabler  <class IOPlatformPluginDevice, id 0x10000045e, registered, matched, active, busy 0 (3 ms), retain 7>
    | |     | +-o ApplePlatformEnabler  <class ApplePlatformEnabler, id 0x100000464, registered, matched, active, busy 0 (0 ms), retain 5>
    | |     +-o AGPMEnabler  <class IOPlatformPluginDevice, id 0x10000045f, registered, matched, active, busy 0 (2 ms), retain 7>
    | |     | +-o AGPMController  <class AGPMController, id 0x100000461, !registered, !matched, active, busy 0, retain 4>
    | |     +-o X86PlatformShim  <class X86PlatformShim, id 0x100000460, !registered, !matched, active, busy 0, retain 4>
    | +-o CPU1@2  <class IOACPIPlatformDevice, id 0x100000129, registered, matched, active, busy 0 (87 ms), retain 8>
    | | +-o AppleACPICPU  <class AppleACPICPU, id 0x100000132, registered, matched, active, busy 0 (0 ms), retain 6>
    | +-o CPU2@4  <class IOACPIPlatformDevice, id 0x10000012a, registered, matched, active, busy 0 (87 ms), retain 8>
    | | +-o AppleACPICPU  <class AppleACPICPU, id 0x100000133, registered, matched, active, busy 0 (0 ms), retain 6>
    | +-o CPU3@6  <class IOACPIPlatformDevice, id 0x10000012b, registered, matched, active, busy 0 (88 ms), retain 8>
    | | +-o AppleACPICPU  <class AppleACPICPU, id 0x100000134, registered, matched, active, busy 0 (0 ms), retain 6>
    | +-o CPU4  <class IOACPIPlatformDevice, id 0x10000012c, registered, matched, active, busy 0 (88 ms), retain 7>
    | +-o CPU5  <class IOACPIPlatformDevice, id 0x10000012d, registered, matched, active, busy 0 (88 ms), retain 7>
    | +-o CPU6  <class IOACPIPlatformDevice, id 0x10000012e, registered, matched, active, busy 0 (88 ms), retain 7>
    | +-o CPU7  <class IOACPIPlatformDevice, id 0x10000012f, registered, matched, active, busy 0 (88 ms), retain 7>
    | +-o io-apic@fec00000  <class IOACPIPlatformDevice, id 0x100000130, registered, matched, active, busy 0 (0 ms), retain 7>
    | | +-o AppleAPICInterruptController  <class AppleAPICInterruptController, id 0x10000013a, registered, matched, active, busy 0 (0 ms), retain 8>
    | +-o AppleACPIEventController  <class AppleACPIEventController, id 0x10000013b, !registered, !matched, active, busy 0, retain 6>
    | +-o boot-ec  <class IOACPIPlatformDevice, id 0x10000013c, registered, matched, active, busy 0 (2 ms), retain 7>
    | | +-o AppleACPIEC  <class AppleACPIEC, id 0x10000013d, registered, matched, active, busy 0 (0 ms), retain 6>
    | +-o bios  <class IOPlatformDevice, id 0x10000013e, registered, matched, active, busy 0 (0 ms), retain 6>
    | | +-o AppleSMBIOS  <class AppleSMBIOS, id 0x10000013f, registered, matched, active, busy 0 (0 ms), retain 5>
    | +-o PCI0@0  <class IOACPIPlatformDevice, id 0x100000143, registered, matched, active, busy 0 (981 ms), retain 47>
    | | +-o AppleACPIPCI  <class AppleACPIPCI, id 0x10000022a, registered, matched, active, busy 0 (964 ms), retain 35>
    | |   +-o MCHC@0  <class IOPCIDevice, id 0x1000001c2, registered, matched, active, busy 0 (0 ms), retain 8>
    | |   +-o PEG0@1  <class IOPCIDevice, id 0x1000001c3, registered, matched, active, busy 0 (86 ms), retain 12>
    | |   | +-o IOPP  <class IOPCI2PCIBridge, id 0x10000023b, registered, matched, active, busy 0 (85 ms), retain 10>
    | |   |   +-o GFX0@0  <class IOPCIDevice, id 0x1000001c4, registered, matched, active, busy 0 (85 ms), retain 35>
    | |   |   | +-o AMDSupport  <class AMDSupport, id 0x1000003c5, registered, matched, active, busy 0 (0 ms), retain 5>
    | |   |   | +-o AMD9500ControllerWrangler  <class AMD9500ControllerWrangler, id 0x1000003c6, registered, matched, active, busy 0 (0 ms), retain 7>
    | |   |   | | +-o AppleGraphicsDeviceControlClient  <class AppleGraphicsDeviceControlClient, id 0x10000051c, !registered, !matched, active, busy 0, retain 5>
    | |   |   | +-o AMDRadeonX4000_AMDRadeonHWServicesPolaris  <class AMDRadeonX4000_AMDRadeonHWServicesPolaris, id 0x1000003e3, registered, matched, active, busy 0 (1 ms), retain 7>
    | |   |   | | +-o AMDRadeonX4200_AMDRadeonHWLibs  <class AMDRadeonX4200_AMDRadeonHWLibs, id 0x1000003e9, !registered, !matched, active, busy 0, retain 4>
    | |   |   | +-o AMD9500Controller  <class AMD9500Controller, id 0x1000003e4, registered, matched, active, busy 0 (0 ms), retain 6>
    | |   |   | +-o ATY,Florin@0  <class AtiFbStub, id 0x1000003f0, registered, matched, active, busy 0 (3 ms), retain 8>
    | |   |   | | +-o […]
    | |   |   | +-o […]
    | |   |   +-o HDAU@0,1  <class IOPCIDevice, id 0x1000001c6, registered, matched, active, busy 0 (24 ms), retain 10>
    | |   |     +-o AppleGFXHDAEGController@0,1  <class AppleGFXHDAEGController, id 0x1000003cf, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |       +-o AppleGFXHDADriver@0,1,0  <class AppleGFXHDADriver, id 0x10000042f, registered, matched, active, busy 0 (0 ms), retain 7>
    | |   +-o IGPU@2  <class IOPCIDevice, id 0x1000001ca, registered, matched, active, busy 0 (332 ms), retain 12>
    | |   | +-o AppleIntelFramebufferController  <class AppleIntelFramebufferController, id 0x1000003c9, registered, matched, active, busy 0 (1 ms), retain 8>
    | |   | | +-o IntelFBClientControl  <class IntelFBClientControl, id 0x10000044c, registered, matched, active, busy 0 (0 ms), retain 8>
    | |   | | | +-o AppleGraphicsDeviceControlClient  <class AppleGraphicsDeviceControlClient, id 0x10000051f, !registered, !matched, active, busy 0, retain 5>
    | |   | | +-o AppleIntelMEClientController  <class AppleIntelMEClientController, id 0x10000044f, registered, matched, active, busy 0 (0 ms), retain 7>
    | |   | +-o IntelAccelerator  <class IntelAccelerator, id 0x1000003cb, registered, matched, active, busy 0 (2 ms), retain 14>
    | |   |   +-o IGAccelDevice  <class IGAccelDevice, id 0x1000005eb, !registered, !matched, active, busy 0, retain 6>
    | |   |   +-o IGAccelSharedUserClient  <class IGAccelSharedUserClient, id 0x1000005ec, !registered, !matched, active, busy 0, retain 6>
    | |   |   +-o IGAccelVideoContextMain  <class IGAccelVideoContextMain, id 0x1000005ed, !registered, !matched, active, busy 0, retain 6>
    | |   |   +-o IGAccelVideoContextMedia  <class IGAccelVideoContextMedia, id 0x1000005ee, !registered, !matched, active, busy 0, retain 6>
    | |   |   +-o IGAccelVideoContextVEBox  <class IGAccelVideoContextVEBox, id 0x1000005ef, !registered, !matched, active, busy 0, retain 6>
    | |   +-o XHC1@14  <class IOPCIDevice, id 0x10000021b, registered, matched, active, busy 0 (504 ms), retain 12>
    | |   | +-o XHC1@14000000  <class AppleUSBXHCISPT, id 0x10000024a, registered, matched, active, busy 0 (502 ms), retain 123>
    | |   |   +-o HS02@14100000  <class AppleUSB20XHCIPort, id 0x1000002d2, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |   +-o HS03@14200000  <class AppleUSB20XHCIPort, id 0x1000002d3, registered, matched, active, busy 0 (21 ms), retain 15>
    | |   |   | +-o FT232R USB UART@14200000  <class IOUSBHostDevice, id 0x10000031a, registered, matched, active, busy 0 (21 ms), retain 23>
    | |   |   |   +-o AppleUSBHostLegacyClient  <class AppleUSBHostLegacyClient, id 0x100000326, !registered, !matched, active, busy 0, retain 10>
    | |   |   |   +-o AppleUSBHostCompositeDevice  <class AppleUSBHostCompositeDevice, id 0x100000331, !registered, !matched, active, busy 0, retain 4>
    | |   |   |   +-o FT232R USB UART@0  <class IOUSBHostInterface, id 0x100000333, registered, matched, active, busy 0 (18 ms), retain 10>
    | |   |   |     +-o AppleUSBFTDI  <class AppleUSBFTDI, id 0x1000003a3, registered, matched, active, busy 0 (10 ms), retain 6>
    | |   |   |       +-o IOSerialBSDClient  <class IOSerialBSDClient, id 0x1000003ba, registered, matched, active, busy 0 (0 ms), retain 5>.    <—————————THERE

For the FTDI driver itself, the only parent not on the code above is the IOResources itself :

+-o IOResources  <class IOResources, id 0x100000117, registered, matched, active, busy 0 (6078 ms), retain 40>

I have tried it with several iMacs and MacBooks (“regular” as well as “pro” computers) and the same thing happens with every one of them when they run a freshly installed Mojave OS. However, some of them don’t have the issue (the AppleFTDI driver instance is not present in the ioreg, even at startup) on more heavily loaded systems, with many softwares and drivers installed, so my guess is that some softwares that also interact with FTDI chips (e.g. Google Chrome, Arduino Agent) are able to “fix” the issue…

Do you guys have an idea what is going on and how to fix it? Disabling the AppleFTDI driver works, but I really don’t like this option, as it means removing the system integrity protection and I have no idea how the system will react with the subsequent macOS updates. And, as a reminder, removing the FTDI driver is not an option as I need its greater versatility. Is this a bug in the apple driver version?

Thanks in advance!

Bertrand

PS : software and kext version :

0 Answers0