I'm developing firmware for a USB device with an STM32F070 microcontroller. I generated a bare-metal (no-OS) code base with STM32CubeMX, setting the device up as a USB CDC (Communications Device Class), so that it is automatically detected as a VCP (Virtual COM Port) by Windows 7, 8, and 10. Driver Details shows that it is using the Windows usbser.sys driver.
When I change the USB Vendor ID (VID) or Product ID (PID) or Manufacturer String, it is still quickly detected as a USB Serial Device by Windows 10 Device Manager, but not by Windows 7 or 8. Windows 7 and 8 spend a long time searching Windows Update for a driver, and then are unable to find one.
How can I modify the device firmware/descriptors to enable Windows 7 and 8 hosts to automatically install the usbser.sys driver for the device when it has vendor-specific values for the USB VID, PID, and Manufacturer String?


the problem is the
.inffile. in win 10 there is a new one (usbser.inf) that loads the driverusbser.sysautomatically in win 7 and 8 you have to write your own.inffile that links your PID and VID to theusbser.sysdriver, see https://msdn.microsoft.com/de-de/library/windows/hardware/ff538820%28v=vs.85%29.aspx and https://msdn.microsoft.com/de-de/library/windows/hardware/dn707976%28v=vs.85%29.aspxsource: https://msdn.microsoft.com/de-de/library/windows/hardware/dn707976%28v=vs.85%29.aspx
In https://msdn.microsoft.com/de-de/library/windows/hardware/dn707976%28v=vs.85%29.aspx, Do I need to write my own host side USB driver for a CDC device and https://community.nxp.com/thread/301439 are example .inf files for win 7 and 8.