Universal Serial Bus (USB)

Universal Serial Bus (USB) provides an expandable Plug and Play serial interface that ensures a standard, low-cost connection for peripheral devices. USB devices include keyboards, mice, joysticks, printers, scanners, storage devices, modems, video conferencing cameras, and more.

The USB-IF is a Special Interest Groups (SIGs) that maintains the Official USB Specification, test specifications, and tools.

Windows operating systems include native support for USB host controllers, hubs, and devices and systems that comply with the official USB specification. Windows also provides programming interfaces that you can use to develop device drivers and applications that communicate with a USB device.

USB for device builders iconUSB for driver developers iconUSB for app developers iconUSB HCK certification icon

USB in Windows

  • Windows support for USB Type-C connectors: For OEMs who want to build a Windows system with USB Type-C connectors.

  • Universal Serial Bus 4 (USB4™): Provides OEMs, IHVs, and silicon vendors bringing up Windows systems supporting USB4 with information about the USB4 connection manager, facilitating debugging, and bring-up procedures.

  • USB FAQ: Frequently asked questions from driver developers about the USB stack and features that are supported in USB.

  • Microsoft OS Descriptors for USB Devices: Windows defines MS OS descriptors that allows better enumeration when connected to system running Windows operating system.

Development tools

USB samples

Create a USB driver or app for Windows

Introduces you to USB driver development. Provides information about choosing the most appropriate model for providing a USB driver for your device.

Write a USB client driver (KMDF, UMDF)

This section includes tutorials about writing your first user-mode and kernel-mode USB drivers by using the USB templates included with Microsoft Visual Studio.

Write a USB host controller driver

Write a host controller driver that communicates with UCX if:

  • You're developing an xHCI host controller that isn't compliant with the specification.
  • You're developing a custom non-xHCI hardware, such as a virtual host controller.

For example, consider a wireless dock that supports USB devices. The PC communicates with USB devices through the wireless dock by using USB over TCP as a transport.

Write a function controller driver for a USB device

You can develop a controller driver that handles all USB data transfers and commands sent by the host to the device. This driver communicates with the Microsoft-provided USB function controller extension (UFX).

Developing Windows drivers for USB function controllers

USB function class extensions (UFX) reference

Write a USB Type-C connector driver

Windows 10 introduces support for the new USB connector: USB Type-C. You can write a driver for the connector that communicates with the Microsoft-provided class extension module: UcmCx to handle scenarios related to Type-C connectors such as, which ports support Type-C, which ports support power delivery.

Developing Windows drivers for USB Type-C connectors

USB connector manager class extensions (UcmCx) reference

Write a USB dual-role controller driver

USB Dual Role controllers are now supported in Windows 10. Windows includes in-box client drivers for ChipIdea and Synopsis controllers. For other controllers, Microsoft provides a set of programming interfaces that allow the dual-role class extension (UrsCx) and its client driver to communicate with each other to handle the role-switching capability of a dual-role controller.

For more information about this feature, see:

USB Dual Role Driver Stack Architecture

USB dual-role controller driver programming reference

Write a USB driver for emulated devices

You can develop an emulated Universal Serial Bus (USB) host controller driver and a connected virtual USB device. Both components are combined into a single KMDF driver that communicates with the Microsoft-provided USB device emulation class extension (UdeCx).

Developing Windows drivers for emulated USB devices (UDE)

Emulated USB host controller driver programming reference

WDF extension for developing USB drivers

Write a UWP app

  • Talk to USB devices, start to finish: Provides step-by-step instructions about implementing USB features in a UWP app. To write such an app for a USB device, you need Visual Studio and Microsoft Windows Software Development Kit (SDK).

  • Windows.Devices.Usb: UWP namespace programming reference.

Write a Windows desktop app

Testing USB devices with Windows

Overview of Microsoft USB Test Tool (MUTT) devices

Information about tools to:

  • Test your USB hardware or software
  • Capture traces of operations and other system events
  • Observe how the USB driver stack responds to a request sent by a client driver or an application

Read an overview of tests in the Hardware Certification Kit that enable hardware vendors and device manufacturers to prepare their USB devices and host controllers for Windows Hardware Certification submission.

Universal Serial Bus 4 (USB4™)

Other Resources for USB

  • Official USB Specification: Provides complete technical details for the USB protocol.

  • Microsoft Windows USB Core Team Blog: Check out posts written by the Microsoft USB Team. The blog focuses on the Windows USB driver stack that works with various USB Host controllers and USB hubs found in Windows PC. A useful resource for USB client driver developers and USB hardware designers to understand the driver stack implementation, resolve common issues, and explain how to use tools for gathering traces and log files.

  • OSR Online Lists - ntdev: Discussion list managed by OSR Online for kernel-mode driver developers.

  • Windows Hardware Dev Center: Miscellaneous resources based on frequently asked questions from developers who are new to developing USB devices and drivers that work with Windows operating systems.

USB hardware for learning

  • MUTT devices: MUTT and SuperMUTT devices and the accompanying software package are integrated into the HCK suite of USB tests. They provide automated testing that can be used during the development cycle of USB controllers, devices, and systems, especially stress testing.

  • OSR USB FX2 Learning Kit: If you're new to USB driver development. The kit is the most suitable to study USB samples included in this documentation set. You can get the learning kit from OSR Online Store.

Learn about Microsoft-provided USB drivers

  • USB device-side drivers in Windows: Describes the architecture of the USB function stack.

  • USB host-side drivers in Windows: Provides an overview of the Universal Serial Bus (USB) driver stack architecture. Microsoft provides a core stack of drivers that interoperate with devices that are connected to EHCI and xHCI controllers.

  • USB-IF device class drivers: Lists the Microsoft-provided drivers for the supported USB device classes. Windows provides in-box device class drivers for many USB-IF approved device classes, audio, mass storage, and so on.

  • USB generic function driver–WinUSB: WinUSB is a generic driver for USB devices that is included with all versions of Windows since Windows Vista. Windows provides Winusb.sys that can be loaded as a function driver for a custom device and a function of a composite device.

  • USB generic parent driver for composite devices–Usbccgp: Parent driver for USB devices with multiple functions. Usbccgp creates physical device objects (PDOs) for each of those functions. Those individual PDOs manage their respective USB function drivers, which could be the Winusb.sys driver or a USB device class driver.