Author Topic: CDC + HID Windows INF drivers  (Read 70 times)

JonathanPaton

  • Member
  • ***
  • Posts: 3
CDC + HID Windows INF drivers
« on: July 05, 2019, 11:46:50 am »
Hello,

I'm struggling to create Windows INF files for a composite CDC + HID (Keyboard) solution made using the Keil Middleware USB stack. My problem is that although I can get HID working without installing a HID driver, the HID stops working once I have installed my CDC driver. I believe that the reason the HID stops working is that Windows doesn't load default drivers because the CDC driver contains the VID/PID combination for the device. CDC works as expected with the driver installed.

What I believe that I need is an INF file that associates the HID interface of my device to the generic Windows HID drivers. It would contain the same VID/PID combination as the other INF file, but the USB interface selected within the file would be different. I'm having huge trouble finding any example of this kind of file, and there is an overwhelming volume of Windows driver documentation, so I am hoping that someone who has knowledge of creating composite devices can help this poor soul.

Thank you,

Jonathan Paton

PS: The Keil USB stack automatically creates Interface Association Descriptors (IAD) when CDC and HID are selected. It would not be easy to have USB descriptors without it.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2836
    • Lakeview Research
Re: CDC + HID Windows INF drivers
« Reply #1 on: July 05, 2019, 09:01:13 pm »
Yes, one interface would be HID and the other interfaces would be CDC.

The CDC's INF file should specify the CDC interface, &MI_xx, not the whole device.

If you have an INF file that assigns CDC to the whole device, Windows might prefer that INF file, depending on INF file signing, etc. So rename the extension of, move, or delete any such file.


Then with the device attached, open Windows Device Manager and uninstall the device (under Driver). Then reattach.

The SetupAPI Text Logs can offer clues:

https://docs.microsoft.com/en-us/windows-hardware/drivers/install/setupapi-text-logs






JonathanPaton

  • Member
  • ***
  • Posts: 3
Re: CDC + HID Windows INF drivers
« Reply #2 on: July 09, 2019, 12:36:16 pm »
Jan, thank you for your reply.

Although my device has IAD descriptors, will I need an INF file for the composite as well?

Jonathan Paton

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2836
    • Lakeview Research
Re: CDC + HID Windows INF drivers
« Reply #3 on: July 09, 2019, 10:09:45 pm »
I believe you do need an INF file if the CDC function doesn't apply to the entire device. Unless that has changed with Windows updates.

JonathanPaton

  • Member
  • ***
  • Posts: 3
Re: CDC + HID Windows INF drivers
« Reply #4 on: July 10, 2019, 12:22:27 pm »
Jan, thank you again for your help.

I now have CDC + HID working on Windows 10 with two INF files. One of these INF files is for the composite device and the other is for CDC. I don't need an INF file for HID as Windows automatically loads what I need. I now need to get it working with older versions of Windows.

Jonathan Paton

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2836
    • Lakeview Research
Re: CDC + HID Windows INF drivers
« Reply #5 on: July 10, 2019, 03:07:25 pm »
Excellent, thanks for reporting back.