usbdriveruartcdc

Why the usbser.sys is not used with a USB CDC-ACM device?


The Microsoft article "USB serial driver (Usbser.sys)" tells that:

If you want to load Usbser.sys automatically, set the class code to 02 and subclass code to 02 in the Device Descriptor.

If I program a STM32 MCU with a CDC example with 02 class code (CDC) and 02 subclass code (ACM), the usbser.sys loads. And this makeshift USB-UART bridge detected as "Ports (COM and LPT)/COM5". If I use some USB-UART bridge IC (like FT232), commonly it's class is "Vendor specific" and they need a vendors driver. If the vendor driver has install this devices are also detected as "Ports (COM and LPT)/COMx"

The Cypress USB-UART bridge CY7C65213 has 02/02 class/subclass in the descriptor. But without the Cypress driver, this IC detected as "Other devices/Virtual Serial Port Device 00".

Actually, I can install the Cypress driver, this IC will detected as COMx and my soft will work well.

But I want to understand why the usbser.sys driver is not loading with this device? How can the Windows understand that some USB CDC-ACM devices need the usbser.sys and the other don't need this driver? Is the difference in the descriptor or somwehere else? What instruments shall I use to spot the difference and to tell one devices from other?


Solution

  • If you open C:\Windows\inf\usbser.inf in a text editor you can see what kinds of devices it matches:

    [Standard.NTamd64]
    %UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02&Prot_01
    %UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02
    

    This part tells us that it only matches devices that have a compatible ID equal to "USB\Class_02&SubClass_02&Prot_01" or "USB\Class_02&SubClass_02&Prot_01". I am guessing your Cypress device either doesn't have those compatible IDs, or it has some other driver that is matching that device using more specific IDs.

    You can see the compatible IDs of your device by double-clicking on it in the Device Manager and going to the Details tab. It also helps to view devices by connection so you can know whether you are clicking on an actual USB device or just one of its child devices.