3

I'm using FTDI's managed wrapper for the ftd2xx.dll of their D2XX driver to access a USB device. The wrapper works as expected when it is used in a .NET Framework or .NET Core console application. However, when I use the wrapper in a UWP (Universal Windows Platform) app it does not:

GetNumberOfDevices/FT_CreateDeviceInfoList reports the correct number of connected devices.

GetDeviceList/FT_GetDeviceInfoDetail returns empty FT_DEVICE_INFO_NODE elements except for the flags field that has the value 1. According to the D2XX Programmer's Guide flags 1 indicates "port is open".

I can observe a similar effect in my non UWP apps if I open the device with one instance of the application and try to access it with another. But I have not opened the device in the UWP, since I can't get the required device information and don't know how I could close it. I'm sure there is no other app running that has the device open. If I close the UWP app and start the non UWP app it works fine.

I'm seeing the same behavior with or without the following capability in the app manifest (I'm using the correct values for VID and PID of my device):

  <Capabilities>
    <iot:Capability Name="lowLevelDevices" />
    <DeviceCapability Name="usb">
      <Device Id="vidpid:XXXX XXXX">
        <Function Type="name:vendorSpecific" />
      </Device>
    </DeviceCapability>
  </Capabilities>

Additionally, in the device manager there are sometimes "device not migrated to partial or ambiguous match" warning for the USB device. I updated the driver to the latest version 2.12.28 but still get the warning. Not sure if this is a problem since the driver is working for the non UWP apps.

Are there any restrictions on UWP apps recarding device/USB/driver usage?

Thanks in advance.

wierob
  • 4,299
  • 1
  • 26
  • 27
  • 1
    Have you tried the official [Custom USB device sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CustomUsbDeviceAccess) to see if it will work? – Xie Steven Jan 31 '18 at 06:34
  • Yes I tried the sample but the app is not able to find the device. I added the capabilty to the manifest, added a watcher using my VID and PID in InitializeDeviceWatchers (Scenarion1) and installed the windusb.sys driver for the device. Even if this would find the devcie, I would need to rewrite my app to not depend on the functions provied by ftd2xx.dll. – wierob Jan 31 '18 at 10:44
  • I still get the "device not migrated to partial or ambiguous match" warning when using the winusb.sys driver. – wierob Jan 31 '18 at 11:15
  • @wierob did you find a solution to this? I am facing right now a similar issue... – Vic Jul 06 '20 at 06:23
  • According to Microsoft support it is not possible to use the FTDI USB driver directly from the UWP app. The suggested solution is to embed a full-trust Win32 app which handles the USB communication and establish some kind of interprocess communication between the full-trust component and the main UWP app – wierob Jul 07 '20 at 09:35

0 Answers0