USB Audio 2.0 Drivers - Windows drivers
Driver on

Device firmware update For USB devices without using a co-installer – Windows drivers

USB System distributors use co-installers to replace gadget firmware for gadgets that use inbox USB gadget drivers. Nonetheless, co-installers usually are not supported by the brand new “Common INF” customary, which is a requirement on Home windows 10. This poses a problem to present USB gadget firmware replace course of. This matter outlines a suggest method to replace USB gadget firmware with no co-installer.

Necessities

The first necessities from the USB gadget firmware replace course of are:

  1. Seamless firmware replace with no consumer interplay

  2. Dependable restoration mechanism (for instance, no bricking of gadgets)

  3. Works on Home windows 7 and later

Overview

USB gadgets like UVC cameras are launched with in-field updatable firmware. There is no such thing as a customary method to replace the firmware at the moment. One factor that’s frequent to all present replace mechanism is that some customized software program suite runs on the consumer and downloads the firmware to the gadget. Usually, as a part of the gadget set up course of, the firmware updating software program suite is put in. The co-installer kick begins the firmware replace course of. The absence of co-installers on Home windows 10 prevents gadget distributors from updating the firmware on these gadgets within the subject.

The really helpful method to circumvent the absence of a co-installer for the USB gadget firmware replace situation is to make use of a decrease filter driver to the USB gadget that may kick begin the firmware replace course of. Throughout the AddDevice name, the filter driver will examine the gadget firmware model and replace the firmware if essential.

Firmware replace overview

When a USB gadget is plugged in to the system, the generic inbox driver is put in for the gadget. After the set up of the generic driver, the OS queries the Home windows Replace server for any vendor particular driver bundle availability and downloads it and installs the driving force. The put in driver bundle will carry out the firmware replace.

There are two methods the firmware could possibly be up to date.

  1. Firmware Replace Filter Driver

    1. A vendor equipped decrease filter driver that performs the firmware replace.
  2. Firmware Replace System Driver

    1. A vendor equipped decrease filter driver that places the gadget in “firmware replace mode”.

    2. The gadget enumerates as a firmware replace gadget.

    3. Vendor equipped firmware replace driver will load towards this gadget and updates the firmware.

Methodology 1: Firmware Replace Filter Driver

On this methodology, a decrease filter driver to the USB gadget driver will probably be put in as a part of driver replace course of. This filter driver will carry out the firmware replace.

The motive force replace bundle on the Home windows Replace server will comprise:

Firmware update UMDF lower filter driver method

Whereas putting in the driving force replace bundle, the firmware replace WDF filter driver’s AddDevice routine will probably be referred to as. From this routine, the WDF filter driver will get for the gadget firmware model from the gadget HW registry key. The gadget firmware ought to have positioned the firmware model utilizing the MSOS descriptor onto the gadget HW registry key.

  1. If the gadget firmware model and the filter driver anticipated firmware model are completely different, or

  2. The firmware model is just not out there within the gadget HW registry key

    1. Then, the filter driver will insert itself into the gadget stack by returning success to AddDevice callback.
  3. Else, the filter driver is not going to insert itself into the gadget stack

    1. As a result of there isn’t a necessity for updating the firmware because the gadget has the anticipated firmware.

When the EVT_WDF_DEVICE_D0_ENTRY callback of the WDF filter driver known as at a later level, the filter driver should register for gadget interface change notifications utilizing CM_Register_Notification or IoRegisterPlugPlayNotification (UMDF or KMDF) to hearken to the gadget interface class the USB gadget will register the gadget into. E.g. The firmware replace filter driver for a RGB digital camera would register for KSCATEGORY_VIDEO_CAMERA. On receiving the notification, the filter driver ought to submit a work-item that might carry out the firmware replace.

UMDF primarily based firmware replace drivers can use the gadget particular APIs or subject the management transfers on to entry the USB gadget to carry out the firmware replace. For instance, the UMDF primarily based filter driver for a digital camera would use Digicam APIs to carry out the firmware replace.

KMDF primarily based firmware replace drivers can ship the seller particular instructions to carry out the firmware replace.

On completion of flashing the firmware, the gadget should disconnect and reconnect to the bus. The gadget will probably be re-enumerated with new firmware.

The tactic of utilizing a “firmware replace filter driver”, is really helpful for gadgets which have sufficient assets to carry two full firmware photographs (the replace picture and a backup picture) on the gadget reminiscence. The reason being if there have been failures throughout downloading the up to date firmware, the gadget can abandon the replace and boot into its unique firmware. Thus, not bricking the gadget.

Methodology 2: Firmware Replace System Driver

On this methodology, a decrease filter driver to the USB gadget will probably be put in as a part of the driving force replace course of. This filter driver will ship a command to the gadget to restart in firmware replace mode, the place the gadget exposes a firmware replace interface. The motive force for the firmware replace interface will load and carry out the firmware replace.

The motive force replace bundle on Home windows Replace server for the gadget will comprise:

  1. A WDF decrease filter driver that may place the gadget in firmware replace mode

  2. An extension INF to put in the WDF decrease filter driver

Along with the driving force replace bundle, a separate Firmware Replace System Driver bundle will probably be current on Home windows Replace, with:

  1. A WDF firmware replace gadget driver and its INF, and

  2. The “firmware.bin” file.

Firmware update WDF driver method

Whereas putting in the driving force replace bundle, the WDF decrease filter driver’s AddDevice routine will probably be referred to as. From this routine, the filter driver will question for the gadget firmware model from the gadget HW registry key. The gadget firmware ought to have positioned the “firmware model”, utilizing the MSOS descriptor or the USB gadget’s extension INF, onto the gadget HW registry key.

  1. If the gadget firmware model and the filter driver anticipated firmware variations are completely different or

  2. The firmware model is just not out there within the gadget HW registry key

  3. Then, the WDF filter driver will insert itself into the gadget stack.

  4. Else, the WDF filter driver is not going to insert itself into the gadget stack

When the EVT_WDF_DEVICE_D0_ENTRY callback of the WDF filter driver known as at a later level, the filter driver will subject a vendor particular command to the gadget which can place it in firmware replace mode. i.e. The gadget will disconnect and reconnect, exposing the firmware replace interface.

The system will enumerate the firmware replace gadget interface. A customized firmware replace WDF driver equipped by the seller, within the firmware replace bundle, will probably be load for this firmware replace interface. This driver will replace the firmware.

When the EVT_WDF_DEVICE_D0_ENTRY callback of the WDF firmware replace driver known as at a later level, the driving force should submit a work-item that might carry out the firmware replace.

On completion of flashing the firmware, the gadget should disconnect and reconnect to the bus. The gadget will probably be re-enumerated with new firmware.

This methodology is really helpful for gadgets that can’t maintain the up to date and unique firmware photographs as a result of scarcity of reminiscence on the gadget. The reason being if there have been failures throughout downloading the up to date firmware, the gadget can abandon the replace and boot the gadget into its firmware replace mode once more and the firmware replace might be retried. Thus, not bricking the gadget.

Restoration

The firmware replace course of can fail for numerous causes. If that occurs, when the gadget is enumerated once more, the firmware replace driver could attempt to replace the firmware once more and should fail once more and this replace course of might find yourself in a loop. The firmware replace driver should put an higher restrict to the variety of retries it will probably carry out. When the firmware replace retries will get past a threshold (for instance, Three retries) then the filter driver shouldn’t try to replace the firmware once more, till a brand new model of the driving force is downloaded from WU. The firmware replace driver could use the registry to persist the retry states.

On the finish of gadget firmware replace, we really helpful the gadget reset itself and re-enumerate.

Each strategies of firmware replace, the gadget perform should be stopped earlier than performing the firmware replace. This ensures there are not any open deal with to the gadget and avoids any OS restart requirement.

Pattern INF

;==============================================================================
; Microsoft Extension INF for USB Digicam Firmware Replace UMDF Filter Driver
; Copyright (C) Microsoft Company.  All rights reserved.
;==============================================================================

[Version]
Signature="$WINDOWS NT$"
Class=Extension
ClassGUID={e2f84ce7-8efa-411c-aa69-97454ca4cb57}
Supplier=%CONTOSO%
ExtensionId = {BC6EE554-271C-48C8-B713-8078833962BD} ; exchange with your personal GUID
CatalogFile.NT = SampleExtension.cat
DriverVer=08/28/2017,10.0.1700.000

[SourceDisksFiles]
ContosoFirmwareUpdateFilterDriver.dll=1
ContosoFirmware.bin=1

[SourceDisksNames]
1 = %MediaDescription%

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to driversUMDF
ContosoFirmwareCopy=12,ContosoFirmware ; copy to driversContosoFirmware
DefaultDestDir = 12

[UMDriverCopy]
ContosoFirmwareUpdateFilterDriver.dll

[ContosoFirmwareCopy]
ContosoFirmware.bin

[Manufacturer]
%CONTOSO% = ContosoFirmwareUpdateFilterDriver,ntamd64

[ContosoFirmwareUpdateFilterDriver.ntamd64]
; exchange along with your digital camera gadget VID PID
%ContosoCamera.DeviceDesc% = ContosoFirmwareUpdateFilterDriver_Install, USBVID_1234&PID_1234&REV_1234

[ContosoFirmwareUpdateFilterDriver_Install]
CopyFiles=UMDriverCopy, ContosoFirmwareCopy

[ContosoFirmwareUpdateFilterDriver_Install.HW]
AddReg = ContosoFirmwareUpdateFilterDriver.AddReg

[ContosoFirmwareUpdateFilterDriver.AddReg]
; Load the redirector as an decrease filter on this particular gadget.
; 0x00010008 - FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
HKR,,"LowerFilters",0x00010008,"WUDFRd"

[ContosoFirmwareUpdateFilterDriver_Install.Services]
AddService=WUDFRd,0x000001f8,WUDFRD_ServiceInstall

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%WUDFRd.sys

[ContosoFirmwareUpdateFilterDriver_Install.Wdf]
UmdfService=ContosoFirmwareUpdateFilterDriver, ContosoFirmwareUpdateFilterDriver.UmdfFilter
UmdfServiceOrder=ContosoFirmwareUpdateFilterDriver

[ContosoFirmwareUpdateFilterDriver.UmdfFilter]
UmdfLibraryVersion=2.0.0
ServiceBinary= "%12%UMDFContosoFirmwareUpdateFilterDriver.dll"

[Strings]
CONTOSO = "Contoso Inc."
ContosoCamera.DeviceDesc = "Contoso Digicam Extension"
MediaDescription="Contoso Digicam Firmware Replace Filter Driver Set up Media"
WudfRdDisplayName = "WDF Reflector Driver"

Leave a Reply

Your email address will not be published. Required fields are marked *