Updating Device Firmware using Windows Update

This topic describes how to update a removable or in-chassis device's firmware using the Windows Update (WU) service. For information about updating system firmware, come across Windows UEFI firmware update platform.

To do this, y'all'll provide an update machinery, implemented as a device driver, that includes the firmware payload. If your device uses a vendor-supplied driver, you take the selection of adding the firmware update logic and payload to your existing role driver, or providing a separate firmware update driver package. If your device uses a Microsoft-supplied driver, you lot must provide a split up firmware update commuter parcel. In both cases, the firmware update commuter package must be universal. For more info about universal drivers, see Getting Started with Windows Drivers. The driver binary can use KMDF, UMDF 2 or the Windows Driver Model.

Considering WU cannot execute software, the firmware update commuter must hand the firmware to Plug and Play (PnP) for installation.

Firmware update driver actions

Typically, the firmware update driver is a lightweight device driver that does the following:

  • At device kickoff or in the driver'southward EVT_WDF_DRIVER_DEVICE_ADD callback function:

    1. Place the device to which it is attached.
    2. Determine whether the commuter has a firmware version that is more recent than the version on the firmware currently flashed on device hardware.
    3. If a firmware update is necessary, prepare an event timer to schedule the update.
    4. Otherwise, exercise nothing until the driver is started over again.
  • During system runtime:

    1. If an update is queued, expect for a set up of conditions to exist met.
    2. When conditions are met, perform the firmware update on the device.

Firmware update driver contents

Typically, the firmware update driver package contains the following:

  • Universal Driver INF
  • Driver catalog
  • Office commuter (.sys or .dll)
  • Firmware update payload binary

Submit your firmware update parcel equally a split commuter submission.

Adding firmware update logic to a vendor-supplied driver

The existing function driver tin can implement the firmware update mechanism, every bit shown in the following diagram:

Using Windows Update to deliver firmware update via existing function driver.

Alternatively, if you want to update the part driver and the firmware update driver separately, create a 2d device node, on which you will install the firmware update driver. The following diagram shows how one device tin accept ii separate device nodes:

Using Windows Update to deliver firmware update via separate device node.

In this case, the role and firmware device nodes must accept different hardware IDs in society to exist targeted independently.

At that place are a couple ways to create a second device node. Certain device types have the power to betrayal a 2d device node on one physical device, such every bit USB. You tin use this functionality to create a device node targetable by WU, and install a firmware update driver on information technology. Many device types, nonetheless, practise not allow a unmarried concrete device to enumerate more one device node.

In this case, utilise an extension INF that specifies the AddComponent directive to create a device node that can be targeted by Windows Update and install the firmware update driver on it. The following snippet from an INF file shows how you tin practise this:

              [Manufacturer] %Contoso%=Standard,NTamd64 [Standard.NTamd64] %DeviceName%=Device_Install, PCI\DEVICE_ID [Device_Install.Components] AddComponent=ComponentName,,AddComponentSection [AddComponentSection] ComponentIDs = ComponentDeviceId                          

In the above INF sample, ComponentIDs = ComponentDeviceId indicates that the kid device volition have a hardware ID of SWC\ComponentDeviceId. When installed, this INF creates the post-obit device hierarchy:

Parent device, primary device, AddComponent device.

For future firmware updates, update the INF and binary file containing the firmware payload.

Adding firmware update logic to a Microsoft-supplied commuter

To update firmware for devices that use a Microsoft-supplied driver, you need to create a second device node, as shown above.

Best practices

  • In your firmware update driver INF, specify DIRID 13 to cause PnP to leave the files in the driver bundle in the DriverStore:

                      [Firmware_AddReg] ; Store location of firmware payload HKR,,FirmwareFilename,,"%xiii%\firmware_payload.bin"                                  

    PnP resolves this location when it installs the device. The driver tin and then open this registry central to determine the location of the payload.

  • Firmware update drivers should specify the following INF entries:

                      Class=Firmware ClassGuid={f2e7dd72-6468-4e36-b6f1-6488f42c1b52}                                  
  • To locate some other device node, the firmware driver should walk the device tree relative to itself, not past enumerating all device nodes for a match. A user may take plugged in multiple instances of the device, and the firmware driver should only update the device with which information technology is associated. Typically, the device node to be located is the parent or sibling of the device node on which the firmware driver is installed. For example, in the diagram in a higher place with two device nodes, the firmware update commuter can look for a sibling device to find the function driver. In the diagram immediately above, the firmware commuter can expect for the parent device to find the primary device with which information technology needs to communicate.

  • The driver should be robust to multiple instances of the device existence on the system, perchance with multiple different firmware versions. For example, there may be one example of the device that has been connected and updated several times; a make new device may and then exist plugged in which is several firmware versions one-time. This means that state (such as current version) must be stored against the device, and not in a global location.

  • If there is an existing method to update the firmware (EXE or co-installer, for example), you can largely reuse the update lawmaking within a UMDF commuter.