Export (0) Print
Expand All
7 out of 7 rated this helpful - Rate this topic

Getting started with USB client driver development

This section introduces you to USB driver development. The section applies to you if you are new to driver development; want to implement a driver for a USB device, for which Microsoft does not provide an in-box driver. Such a driver is termed as a USB client driver in this documentation set. The topics in this section describe high-level USB concepts and provide step-by-step instructions about performing common tasks of a USB client driver. For detailed information about those concepts, see USB specifications at USB Documents.

As a driver developer, you must have coding experience in the C programming language, and understand the concepts of function pointers, callback functions, and event handlers. If you are going to write a driver based on the User-Mode Driver Framework, make sure that you familiarize yourself with C++ and COM.

Learning path for USB client driver developers

Learning stepAfter completing the step, you should be able to ...

Step 1—Read the Official USB specification version 2.0 and 3.0.

Learn about the industry specification and different components (device, host controller, and hub) of the architecture. It's important to understand the data flow model, how the host and device communicate with each other, and the format of the requests that the device expects.

Step 2—Obtain a test USB device.

  • Have a USB device and its hardware specification. The specification describes device capabilities and the supported vendor commands. Use the specification to determine the functionality of the device driver and the related design decisions.
  • Have the OSR USB FX2 learning kit if you are 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.
  • Have a Microsoft USB Test Tool (MUTT) devices. MUTT hardware can be purchased from JJG Technologies. The device does not have installed firmware installed. To install firmware, download the MUTT software package from this Web site and run MUTTUtil.exe. For more information, see the documentation included with the package.

Step 3—Study your USB device layout and the related USB descriptors.

Describe your device capabilities by reading the configuration descriptor, interface descriptors for each supported alternate settings, and their endpoint descriptors. By using USBView, you can browse all USB controllers and the USB devices connected to them, and also inspect the device configuration.

Step 4Choose a driver model for developing a USB client driver.

Determine whether you should write a custom driver or use one of the Microsoft-provided drivers based on the design of your device. For writing a driver, choose the best driver model and describe the features supported by each model.

Step 5—Familiarize yourself with the Microsoft-provided USB driver stack and driver development concepts.

  • Understand the fundamentals of how drivers work in Windows operating systems. Knowing the fundamentals will help you make appropriate design decisions and allow you to streamline your development process.
  • Differentiate between user mode and kernel mode driver architecture models.
  • Understand driver loading and how Windows organizes Plug and Play (PnP) devices in a device tree and device nodes. You should also understand how PnP manager builds device stacks and where your driver and its device objects are placed in the device stack.

Step 6—Prepare your development and debugging environment.

  • If you are writing a kernel-mode driver, you should have configured debugging on host and target computers over an Ethernet network, 1394 cable, USB 2.0 or 3.0 debug cable, or a null-modem cable.
  • If you are writing a user-mode driver, you can use the user-mode debuggers available in the Microsoft Visual Studio environment. You should know how to attach to a process or launch a process under the debugger.

Step 7—Write your first driver.

Write, build, and install your first USB client driver by using the USB templates included with Visual Studio 2012. You should be able to describe framework driver, device, and queue objects and understand how the framework communicates with your driver.
Step 8—Extend your driver by sending a USB control transfer request.Send standard control requests and vendor commands to your device. For more information, see How to send a USB control transfer.

Step 9—Extend your driver to use WDF USB I/O target objects to perform USB data transfers. USB data transfers.

Extend your driver to perform common tasks. This topic lists the "How to" topics in this documentation set that provide step-by-step guidance about those tasks.

 

Community Resources for USB

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 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.

USB Technologies

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

Windows Dev-Center for Hardware Development

Download the latest tools for driver development, ensure that your product is reliable and compatible with Windows through the Windows Certification Program, learn Windows hardware development samples.

Related topics

Universal Serial Bus (USB) Drivers
How to enable USB selective suspend and system wake in the UMDF driver for a USB device
USB Driver Development Guide

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.