Updated: July 9, 2004
This paper presents frequently asked questions from developers who are new to developing USB devices and drivers that work with Microsoft Windows operating systems. Unless otherwise specified, the answers to these questions are targeted at Windows 2000 and later operating systems.
See also: USB FAQ - Intermediate
Microsoft Windows operating systems (Windows 98 and later) include native support for devices and systems that comply with the Universal Serial Bus (USB) specification. This article provides answers to frequently asked questions from driver developers about the USB stack and features supported in USB.
This FAQ is for developers who are new to developing USB devices and drivers that work with Windows operating systems.
Unless otherwise specified, the information in this paper pertains to Windows 2000 and later operating systems.
Additional documentation for USB device and driver support is available in the current version of the Windows Driver Development Kit (DDK), through the MSDN developer program library, and on USB - Architecture and Driver Support.
Most desktop and laptop computers sold after 2002 are USB 2.0 enabled. USB 2.0 enabled means that the computer has one or more USB-enhanced host controllers. To determine if your computer running the Windows XP or Windows Server 2003 operating system has a USB-enhanced host controller, follow these steps:
1. Start Device Manager. To do so, click Start, and then click Run. In the Open box, type devmgmt.msc, and then click OK.
Figure 1. Starting Device Manager
2. In the Device Manager window, expand the Universal Serial Bus controllers node. Look for a host controller with the word "Enhanced" in the title. If you find one, your system has USB 2.0 capable ports and has the necessary host controller drivers.
Figure 2: Enhanced host controller with drivers loaded
3. If you do not find an enhanced host controller in step 2, expand the Other Devices section. Look for Universal Serial Bus (USB) Controller. If you find this item, your system has USB 2.0 capable ports, but you need to install drivers for this host controller. If you do not find this item, your system does not have any USB 2.0 ports.
Figure 3: Enhanced host controller without drivers loaded
| • |
Windows 2000 Service Pack 4 (SP4) |
| • |
Windows XP SP1 |
| • | Windows Server 2003 |
Windows 2000 and Windows XP were released before USB 2.0 hardware was available, so the drivers were released for those operating systems in the service packs. To install drivers, follow these steps:
1. Follow the procedure described in the answer to the previous question to verify that your computer has USB 2.0 ports that required you to install a driver for the enhanced host controller.
2. In the Device Manager window, expand the Other Devices section as explained under the previous question, and then double-click Universal Serial Bus (USB) Controller.
3. On the General tab of the Properties dialog box, click Reinstall Driver.
Figure 4. Properties window for EHCI with no drivers
4. In the Add New Hardware Wizard, select Install the software automatically (Recommended), and then click Next. Continue with the wizard, accepting all default options, until you reach the last page of the wizard, and then click Finish. You may have to restart your computer to finish the installation.
For additional information about the availability of USB 2.0 in Windows XP SP1, see Microsoft Knowledge Base article 329632.
Note
Visit Windows Update regularly to ensure that you have the latest updates installed on your machine.
Windows XP SP1 and later service packs contain support for USB 1.1 and USB 2.0. SP1a is available at http://www.microsoft.com/windowsxp/pro/downloads/servicepacks/sp1/default.asp
| • |
Power management. Fixes issues around Selective Suspend and system power management, especially resume from S3 and S4. |
| • |
CPU utilization. Improves algorithms to reduce CPU utilization during large isochronous and bulk USB transfers. |
| • | Isochronous support. Improved support for Hi-Speed isochronous cameras and periodic isochronous devices. |
You do not need to install Windows XP SP1a if you have installed Windows XP SP2 or Windows Server 2003 SP1. If the service pack was installed by the computer manufacturer, it will not appear in Windows Update.
For additional information on the Windows XP SP1 update for USB 1.1 and 2.0, see Microsoft Knowledge Base article 822603.
| • |
Low speed, up to 1.5 Mbps |
| • |
Full speed, up to 12 Mbps |
| • | Hi-Speed, up to 480 Mbps |
Although low speed and full speed existed in the USB 1.1 specification, the USB 2.0 specification added Hi-Speed while maintaining support for low speed and full speed.
There are three specifications for USB host controllers. Most host controllers found in PCs are compliant with one of these specifications; however, each specification is meant to support only a subset of USB 2.0 device speeds, as summarized in Table 1.
Table 1: Host Controllers and Device Speeds Supported
| Type of Host Controller | USB Device Speeds Supported |
USB Enhanced Host Controller (EHCI) | Hi-Speed |
USB Universal Host Controller (UHCI) | Full speed and low speed |
USB Open Host Controller (OHCI) | Full speed and low speed |
Motherboards that support USB 2.0 must have at least one USB enhanced host controller and usually one or more UHCI or OHCI controllers to support full speed and low speed devices.
IHVs must test their devices on all host controller standards and hubs to ensure compatibility.
Windows XP and Windows Server 2003 create a pop-up notice when a Hi-Speed USB 2.0 device is plugged into a USB port that does not support Hi-Speed. To get the fastest performance from the device, the user must click the notice and follow the instructions on the screen.
1. |
Start Device Manager. To do so, click Start, and then click Run. In the Open box, type devmgmt.msc, and then click OK. |
2. |
In the Device Manager window, expand the Universal Serial Bus controllers
node. Look for a host controller with the word "Universal" or "Open" in the title. If you find one, double-click it. |
3. | On the Advanced tab of the Properties dialog box, check the Don't tell me about USB errors checkbox. |
Note
Following this procedure will disable all USB notices, not just "HI-SPEED USB Device plugged into non-HI-SPEED port."
The best way to prevent this notice from appearing is by installing a USB 2.0 hub that is Hi-Speed certified or by purchasing a USB 2.0 EHCI peripheral component interconnect (PCI) add-in card. You can then attach your Hi-Speed USB 2.0 device to these Hi-Speed enabled ports. Most systems sold since 2003 already have USB 2.0 Hi-Speed enabled ports.
For additional information about USB 2.0 support in Windows XP SP1, see Microsoft Knowledge Base article 329632.
The bcdUSB field in the standard device descriptor must accurately report the USB specification release number that the device and its descriptors are compliant with.
| • |
0x0100 (USB 1.0) |
| • |
0x0110 (USB 1.1) |
| • | 0x0200 (USB 2.0) |
Failure to correctly report these values can cause a device to fail tests in the USB test tools available on http://www.microsoft.com/whdc/whql/device/usb.mspx.
Note
All USB hubs must be compliant with USB 1.1 or later. They should not report 0x0100 in the bcdUSB field.
Yes. The Microsoft Natural Keyboard Pro, which has a three-port, bus-powered hub, is an example of a compound multifunction USB device that has a composite device attached to port 1. Two additional ports are exposed to the end user.
The device attached to port 1 is a low-speed composite device. The device has two interfaces, both of which conform to the USB standard device class definition for human interface devices (HID). The composite device provides two HID interfaces instead of multiplexing all collections over a single HID interface using top-level collections. This design was chosen for compatibility with older BIOSs.
In Windows 2000 and later operating systems, a new physical device object (PDO) is created when a device (for example, a USB or PCMCIA device) is moved from one port to another. A new PDO is not created if the hardware reports a unique USB serial number.
To reuse the same PDO and to ensure that the device experience is unchanged whether the device is reinserted into the same port or a new port, hardware vendors must store a serial number on their device. According to the requirements of the "Designed for Windows" logo program, the serial number must be unique for all devices that share the same device installation identifier.
The USB-IF has worked with Microsoft and other USB-IF member companies to develop a list of recommendations for independent hardware vendors to include on their packaging. More information is available on the USB website at http://www.usb.org/developers/packaging/�.
1. |
Start My Computer, and then go to the folder %windir%\system32\drivers. |
2. |
Right-click the USB driver file you want to know about, and then click Properties. |
3. | The version number of the file is shown on the Version tab. |
The following is a list of core USB drivers on Windows XP:
| • |
Usbport.sys |
| • |
Usbhub.sys |
| • |
Usbehci.sys |
| • |
Usbuhci.sys |
| • |
Ushohci.sys |
| • | Usbccgp.sys |
For additional information on each driver, see the Windows DDK.
See the USB-IF FAQ page at http://www.usb.org/developers/usbfaq/�.
Which USB DWG Classes are supported by Microsoft?
Windows supports a number of USB classes that are defined by the USB Device Working Group (DWG). For the current list of USB class specifications and class codes, visit the USB DWG Web site at http://www.usb.org/developers/devclass_docs�
Table 2 highlights the USB DWG classes supported in Windows and also identifies the initial version of Windows in which support for the class was introduced.
Table 2: USB DWG Class support in Windows
| Class Specification | bDeviceClass Code | Driver Name | Minimum OS Support |
Bluetooth class | 0xE0 | Bthusb.sys | Windows XP |
Chip/smart card interface devices (CCID) | 0x0B | Usbccid.sys | Windows Server 2003* |
Hub class | 0x09 | Usbhub.sys | Windows Server 2003 |
Human interface device (HID) | 0x03 | Hidusb.sys | Windows Server 2003 |
Mass storage class (MSC) | 0x08 | Usbstor.sys | Windows Server 2003 |
Printing class | 0x07 | Usbprint.sys | Windows Server 2003 |
Scanning/imaging (PTP) | 0x06 | Usbscan.sys | Windows Server 2003 |
USB Audio class | 0x01 | Usbaudio.sys | Windows Server 2003 |
Modem class (CDC) | 0x02 | Usbser.sys | Windows Server 2003 |
Video class (UVC) | 0x0E | Usbvideo.sys | Windows XP* |
*Special instructions are necessary to load this driver because it may have been released later than the operating system.
Not all features described in a DWG class specification may be supported by Windows class drivers. For additional details on implemented features within a class specification, see the documentation for the Windows DDK.
What device setup class should I use for a custom USB device?
Microsoft provides system-defined setup classes for most device types. System-defined setup class GUIDs are defined in Devguid.h. For additional information, see the DDK. If you are developing a device type for which Microsoft has not provided an existing class GUID, then you can define a new device setup class.
The USB team requires IHVs to use the setup class associated with the type of USB device, not with the bus type. The setup class "USB" (ClassGuid = {36fc9e60-c465-11cf-8056-444553540000}) is reserved only for USB host controllers and USB hubs. It must not be used for other device categories. Using this class incorrectly may cause the device driver to fail hardware compatibility testing.
For a list of Windows class GUIDs, see "System-Supplied Device Setup Classes" in the Windows DDK or online at http://msdn2.microsoft.com/en-us/library/ms791134.aspx.
Why won't my CPU enter C3 if I attach some USB devices?
When a USB device is attached to a PC, the USB host controller polls the frame scheduler in memory. This is a direct memory access (DMA) bus master operation. Any bus master traffic, interrupt, or one of several other system activities are "break events" that will move a CPU out of C3 because, by definition, the CPU's cache cannot be snooped while in C3.
| • |
Hardware removal. In some cases it may be possible for the hardware to be electronically disconnected from the universal serial bus. For example, when storage media is removed from the USB reader, the USB reader can emulate an electronic disconnect and reconnect when the media is reinserted. In this case, the universal serial bus will not prevent C3 transitions, because there are no USB devices on the host controller. |
| • | Selective Suspend. The only alternative available in Windows XP and later operating systems is to support USB Selective Suspend. This feature allows a driver to suspend the USB device it controls when the device becomes idle, even while the system itself remains in a fully operational power state (S0). Selective Suspend is particularly powerful if all USB function drivers support it. If even one driver does not support it, the CPU will be kept out of C3. For additional information on Selective Suspend, see the Driver Development Kit. |
Which USB class drivers support Selective Suspend in Windows XP and Windows Server 2003?
| • |
Usbhub.sys. This driver can selectively suspend a root or external hub when no devices are attached to it or when all devices attached to that hub can be selectively suspended. |
| • |
Hidusb.sys.
This driver can selectively suspend a HID device. It is your responsibility to trigger remote wake signaling on all device state changes. To enable Selective Suspend in the HID stack, the registry value SelectiveSuspendEnabled
must be enabled for the specific VID+PID of the device. For examples, see Input.inf. |
| • |
Bthusb.sys.
This driver can selectively suspend devices on computers running Windows XP SP2 and later. The driver requires the Bluetooth radio to set the self-powered and remote wake bits in the configuration descriptor. The driver selectively suspends the Bluetooth radio when there are no active Bluetooth connections. |
| • | Usbser.sys. This driver can selectively suspend when there are no active modem connections. |
If enough OEMs ask for it, Microsoft may consider supporting Selective Suspend for additional class drivers. Work is also being investigated on future hardware architectures (CPUs, chipsets, and the operating system) to mitigate the problems.
Why can't Windows XP be awakened from S3 by using a USB HID (keyboard/mouse) when it can be awakened from S1?
There are a number of reasons that a PC cannot be awakened by a USB device from S3. Some of them are listed below:
| • |
Incorrect BIOS. Verify that you have the latest BIOS installed on the computer. To get the latest BIOS revision for your computer, visit the website of the OEM or ODM. |
| • |
BIOS not enabled to wake. Some BIOSs make it possible to disable wake from S3 and S4. Verify that the BIOS is enabled to wake from S3. |
| • | USBBIOSx registry not set. A clean install of Windows XP will not have the USBBIOSx registry key. If the OEM or ODM has validated that the BIOS is capable of waking from S3, you need to set this registry key to 0x00 and restart the computer. |
For additional information, see the USB troubleshooter in the Windows XP Help and Support Center.