Libusb.org USB Devices Driver Download



-->

  1. Libusb.org Usb Devices Driver Download Windows 7
  2. Libusb.org USB Devices Driver Download
  3. Libusb.org Usb Devices Driver Download Windows 10
  4. Libusb.org Usb Devices Driver Download Free
  5. Libusb.org Usb Devices Driver Download Manager

In this topic you'll use the USB Kernel-Mode Driver template provided with Microsoft Visual Studio Professional 2019 to write a simple kernel-mode driver framework (KMDF)-based client driver. After building and installing the client driver, you'll view the client driver in Device Manager and view the driver output in a debugger.

For an explanation about the source code generated by the template, see Understanding the KMDF template code for a USB client driver.

When you plug the device into your USB, Windows will look for the associated driver, if it cannot find this driver then you will be prompted to insert the driver disc that came with your device. Common USB Device errors are ‘ usb port not working ‘, ‘device descriptor request failed error’ or ‘bugcodeusbdriver’ issues. (Locate the instrument in the device list. It will be underneath the Argyll LibUSB-win32 devices top level item.) Right click on instrument - Uninstall - click 'Delete the driver software for this device' - OK Proceed then with either Fresh Install of Argyll USB driver or Adding Argyll drivers to existing drivers above.

Prerequisites

Download libusb for free. A cross-platform library that gives apps easy access to USB devices. Library to enable user space application programs to communicate with USB devices. If the device is not yet connected, first install the device-specific driver, such as by using the appropriate installer. After the device-specific driver is installed, Windows 10 will select that driver instead of the standard USB audio 2.0 driver when you first connect the device.

For developing, debugging, and installing a kernel-mode driver, you need two computers:

  • A host computer running Windows 7 or a later version of the Windows operating system. The host computer is your development environment, where you write and debug your driver.
  • A target computer running Windows Vista or a later version of Windows. The target computer has the kernel-mode driver that you want to debug.

Before you begin, make sure that you meet the following requirements:

Software requirements

  • Your host computer hosts your development environment and has Visual Studio Professional 2019.
  • Your host computer has the latest Windows Driver Kit (WDK) for Windows 8. The kit include headers, libraries, tools, documentation, and the debugging tools required to develop, build, and debug a KMDF driver. To get the latest version of the WDK, see Download the Windows Driver Kit (WDK).
  • Your host computer has the latest version of debugging tools for Windows. You can get the latest version from the WDK or you can Download and Install Debugging Tools for Windows.
  • Your target computer is running Windows Vista or a later version of Windows.
  • Your host and target computers are configured for kernel debugging. For more information, see Setting Up a Network Connection in Visual Studio.

Hardware requirements

Get a USB device for which you will be writing the client driver. In most cases, you are provided with 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 USB driver and the related design decisions.

If you are new to USB driver development, use the OSR USB FX2 learning kit to study USB samples included with the WDK. You can get the learning kit from OSR Online. It contains the USB FX2 device and all the required hardware specifications to implement a client driver.

You can also get 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.

Recommended reading

  • Developing Drivers with Windows Driver Foundation, written by Penny Orwick and Guy Smith. For more information, see Developing Drivers with WDF.

Instructions

Step 1: Generate the KMDF driver code by using the Visual Studio Professional 2019 USB driver template

For instructions about generating KMDF driver code, see the steps in Writing a KMDF driver based on a template.

For USB-specific code, select the following options in Visual Studio Professional 2019

  1. In the New Project dialog box, in the search box at the top, type USB.
  2. In the middle pane, select Kernel Mode Driver, USB (KMDF).
  3. Select Next.
  4. Enter a project name, choose a save location, and select Create.

The following screen shots show the New Project dialog box for the USB Kernel-Mode Driver template.

This topic assumes that the name of the Visual Studio project is 'MyUSBDriver_'. It contains the following files:

FilesDescription
Public.hProvides common declarations shared by the client driver and user applications that communicate with the USB device.
<Project name>.infContains information required to install the client driver on the target computer.
Trace.hDeclares tracing functions and macros.
Driver.h; Driver.cDeclares and defines driver entry points and event callback routines.
Device.h; Device.cDeclares and defines event callback routine for the prepare-hardware event.
Queue.h; Queue.cDeclares and defines an event callback routine for the event raised by the framework's queue object.

Step 2: Modify the INF file to add information about your device

Before you build the driver, you must modify the template INF file with information about your device, specifically the hardware ID string.

In Solution Explorer, under Driver Files, double-click the INF file.

In the INF file you can provide information such as the manufacturer and provider name, the device setup class, and so on. One piece of information that you must provide is the hardware identifier of your device.

To provide the hardware ID string:

  1. Attach your USB device to your host computer and let Windows enumerate the device.

  2. Open Device Manager and open properties for your device.

  3. On the Details tab, select Hardward Ids under Property.

    The hardware ID for the device is displayed in the list box. Select and hold (or right-click) and copy the hardware ID string.

  4. Replace USBVID_vvvv&PID_pppp in the following line with your hardware ID string.

    [Standard.NT$ARCH$] %MyUSBDriver_.DeviceDesc%=MyUSBDriver__Device, USBVID_vvvv&PID_pppp

Step 3: Build the USB client driver code

To build your driver

  1. Open the driver project or solution in Visual Studio Professional 2019
  2. Select and hold (or right-click) the solution in the Solution Explorer and select Configuration Manager.
  3. From the Configuration Manager, select the Active Solution Configuration (for example, Windows 8 Debug or Windows 8 Release) and the Active Solution Platform (for example, Win32) that correspond to the type of build you're interested in.
  4. From the Build menu, select Build Solution.

For more information, see Building a Driver.

Step 4: Configure a computer for testing and debugging

To test and debug a driver, you run the debugger on the host computer and the driver on the target computer. So far, you have used Visual Studio on the host computer to build a driver. Next you need to configure a target computer. To configure a target computer, follow the instructions in Provision a computer for driver deployment and testing.

Step 5: Enable tracing for kernel debugging

The template code contains several trace messages (TraceEvents) that can help you track function calls. All functions in the source code contain trace messages that mark the entry and exit of a routine. For errors, the trace message contains the error code and a meaningful string. Because WPP tracing is enabled for your driver project, the PDB symbol file created during the build process contains trace message formatting instructions. If you configure the host and target computers for WPP tracing, your driver can send trace messages to a file or the debugger.

To configure your host computer for WPP tracing

  1. Create trace message format (TMF) files by extracting trace message formatting instructions from the PDB symbol file.

    You can use Tracepdb.exe to create TMF files. The tool is located in the <install folder>Windows Kits8.0bin<architecture> folder of the WDK. The following command creates TMF files for the driver project.

    tracepdb -f [PDBFiles] -p [TMFDirectory]

    The -f option specifies the location and the name of the PDB symbol file. The -p option specifies the location for the TMF files that are created by Tracepdb. For more information, see Tracepdb Commands.

    At the specified location you'll see three files (one per .c file in the project). They are given GUID file names.

  2. In the debugger, type the following commands:

    1. .load Wmitrace

      Loads the Wmitrace.dll extension.

    2. .chain

      Verify that the debugger extension is loaded.

    3. !wmitrace.searchpath +<TMF file location>

      Add the location of the TMF files to the debugger extension's search path.

      The output resembles this:

      Trace Format search path is: 'C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE;c:driverstmf'

To configure your target computer for WPP tracing

  1. Make sure you have the Tracelog tool on your target computer. The tool is located in the <install_folder>Windows Kits8.0Tools<arch> folder of the WDK. For more information, see Tracelog Command Syntax.

  2. Open a Command Window and run as administrator.

  3. Type the following command:

    tracelog -start MyTrace -guid #c918ee71-68c7-4140-8f7d-c907abbcb05d -flag 0xFFFF -level 7-rt -kd

    The command starts a trace session named MyTrace.

    The guid argument specifies the GUID of the trace provider, which is the client driver. You can get the GUID from Trace.h in the Visual Studio Professional 2019 project. As another option, you can type the following command and specify the GUID in a .guid file. The file contains the GUID in hyphen format:

    tracelog -start MyTrace -guid c:driversProvider.guid -flag 0xFFFF -level 7-rt -kd

    You can stop the trace session by typing the following command:

    tracelog -stop MyTrace

Step 6: Deploy the driver on the target computer

  1. In the Solution Explorer window, select and hold (or right-click) the <project name>Package , and choose Properties.
  2. In the left pane, navigate to Configuration Properties > Driver Install > Deployment.
  3. Check Enable deployment, and check Import into driver store.
  4. For Remote Computer Name, specify the name of the target computer.
  5. Select Install and Verify.
  6. Select Ok.
  7. On the Debug menu, choose Start Debugging, or press F5 on the keyboard.

Note Do not specify the hardware ID of your device under Hardware ID Driver Update. The hardware ID must be specified only in your driver's information (INF) file.

For more information about deploying the driver to the target system in Visual Studio Professional 2019, see Deploying a Driver to a Test Computer.

You can also manually install the driver on the target computer by using Device Manager. If you want to install the driver from a command prompt, these utilities are available:

  • This tool comes with the Windows. It is in WindowsSystem32. You can use this utility to add the driver to the driver store.

    For more information, see PnPUtil Examples.

  • This tool comes with the WDK. You can use it to install and update drivers.

Step 7: View the driver in Device Manager

  1. Enter the following command to open Device Manager:

    devmgmt

  2. Verify that Device Manager shows a node for the following node:

    Samples

    MyUSBDriver_Device

Step 8: View the output in the debugger

Visual Studio first displays progress in the Output window. Then it opens the Debugger Immediate Window. Verify that trace messages appear in the debugger on the host computer. The output should look like this, where 'MyUSBDriver_' is the name of the driver module:

Related topics

Jmicron network provider. Understanding the KMDF template code for a USB client driver
Getting started with USB client driver development

  • INSTALLATION
    • Prerequisites
      • Windows
  • METHODS/FUNCTIONS
    • Library initialization/deinitialization
    • Device handling and enumeration
    • Miscellaneous
    • USB descriptors
      • get_active_config_descriptor
      • get_bos_descriptor
    • Synchronous device I/O

USB::LibUSB - Perl interface to the libusb-1.0 API.

This module provides a Perl interface to the libusb-1.0 API. It provides access to most basic libusb functionality including read-out of device descriptors and synchronous device I/O.

Staying as close as possible to the libusb-1.0 API, this module adds convenient error handling and additional high-level functionality (e.g. device discovery with vid, pid and serial number). Easy to build more functionality without knowing about XS.

Prerequisites

Linux/UNIX

This requires libusb (>= 1.0.17) development files and pkg-config installed.

On Debian like Linux:

On Cygwin you need the pkg-config, libusb1.0-devel and libcrypt-devel packages.

Windows

On Windows you have to manually download the libusb binaries from http://libusb.info and extract them somewhere.

Assuming that the location of the extracted libusb folder is C:Userssimonlibusb-1.0, you need to set the USB_LIBUSB_INCLUDE and USB_LIBUSB_LIB environment variables as follows:

You will also need to add

to the Path environment variable.

For StrawberryPerl, version 5.26 or newer is required (see https://rt.cpan.org/Public/Bug/Display.html?id=121219).

Driver Installation

On Windows you need an additional driver to use a device with libusb. See the Windows section in the libusb wiki.

Building USB::LibUSB

The rest of the installation can be done by a CPAN client like cpanm:

Library initialization/deinitialization

set_debug

init

exit

last_retval

Get return value of last called libusb function.

Device handling and enumeration

get_device_list

Returned elements are USB::LibUSB::Device objects.

get_bus_number

get_port_number

get_port_numbers

get_parent

get_device_address

get_device_speed

get_max_packet_size

get_max_iso_packet_size

ref_device

unref_device

open

Return a USB::LibUSB::Device::Handle object.

open_device_with_vid_pid

Return a USB::LibUSB::Device::Handle object. If the vid:pid combination is not unique, return the first device which is found.

open_device_with_vid_pid_unique

Like open_device_with_vid_pid, but croak in case of multiple devices with this vid:pid combination.

Libusb.org Usb Devices Driver Download Windows 7

open_device_with_vid_pid_serial

Like open_device_with_vid_pid, but also requires a serial number.

close

get_device

get_configuration

set_configuration

claim_interface

release_interface

set_interface_alt_setting

clear_halt

reset_device

kernel_driver_active

detach_kernel_driver

attach_kernel_driver

set_auto_detach_kernel_driver

Throws exception on Windows and Darwin.

Miscellaneous

libusb_has_capability

libusb_error_name

libusb_get_version

Return hashref $version_hash with the following keys:

major
minor
micro
nano
rc

libusb_setlocale

libusb_strerror

USB descriptors

All descriptors are returned as hash references.

get_device_descriptor

Return hashref $desc with the following keys

bLength
bDescriptorType
bcdUSB
bDeviceClass
bDeviceSubClass
bDeviceProtocol
bMaxPacketSize0
idVendor
idProduct
bcdDevice
iManufacturer
iProduct
iSerialNumber
bNumConfigurations

All keys hold a scalar value.

get_active_config_descriptor

Return hashref $config with the following keys:

bLength
bDescriptorType
wTotalLength
bNumInterfaces
bConfigurationValue
iConfiguration
bmAttributes
MaxPower
interface
extra

With the exception of interface, all values are scalars. interface holds an arrayref of bNumInterfaces interface descriptors. Each interface consists of an array of alternate settings. These are hashrefs with the following keys:

bLength
bDescriptorType
bInterfaceNumber
bAlternateSetting
bNumEndpoints
bInterfaceClass
bInterfaceSubClass
bInterfaceProtocol
iInterface
endpoint
extra

With the exception of endpoint, all values are scalars. endpoint holds an arrayref of endpoint descriptors. These are hashrefs with the following keys:

bLength
bDescriptorType
bEndpointAddress
bmAttributes
wMaxPacketSize
bInterval
bRefresh
bSynchAddress
extra

All values are scalars. If the endpoint supports USB 3.0 SuperSpeed, the hashref will contain an additional key superspeed which holds a SuperSpeed Endpoint Companion descriptor with the following keys:

bLength
bDescriptorType
bMaxBurst
bmAttributes
wBytesPerInterval

Example

Dump $config with YAML::XS:

For a Linux Foundation 3.0 root hub:

get_config_descriptor

Return config descriptor as hashref.

get_config_descriptor_by_value

Driver

Return config descriptor as hashref.

get_bos_descriptor

Return BOS descriptor as hashref with the following keys:

bLength
bDescriptorType
wTotalLength
bNumDeviceCaps
dev_capability

dev_capability holds an arrayref of BOS Device Capability descriptors. They have the following keys:

bLength
bDescriptorType
bDevCapabilityType
dev_capability_data

Additional parsing of the capability data is performed if bDevCapabilityType has one of the following values:

Libusb.org USB Devices Driver Download

LIBUSB_BT_USB_2_0_EXTENSION

The hashref will contain a key usb_2_0_extension.

LIBUSB_BT_SS_USB_DEVICE_CAPABILITY

The hashref will contain a key ss_usb_device_capability.

LIBUSB_BT_CONTAINER_ID

The hashref will contain a key container_id.

Example

Dump $bos with YAML::XS:

For a Linux Foundation 3.0 root hub:

get_string_descriptor_ascii

get_descriptor

get_string_descriptor

Device hotplug event notification

To be implemented.

Asynchronous device I/O

To be implemented.

Polling and timing

To be implemented.

Synchronous device I/O

control_transfer_write

control_transfer_read

bulk_tranfer_write

bulk_transfer_read

interrupt_transfer_write

Libusb.org Usb Devices Driver Download Windows 10

interrupt_transfer_read

Please report bugs at https://github.com/lab-measurement/USB-LibUSB/issues.

Libusb.org Usb Devices Driver Download Free

Feel free to contact us at the #labmeasurement channel on Freenode IRC.

Simon Reinhardt, <simon.reinhardt@physik.uni-r.de>

Copyright (C) 2017 by Simon Reinhardt

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.0 or, at your option, any later version of Perl 5 you may have available.

To install USB::LibUSB, copy and paste the appropriate command in to your terminal.

Libusb.org Usb Devices Driver Download Manager

For more information on module installation, please visit the detailed CPAN module installation guide.