Updating Device Firmware Using Windows Replace – Windows Drivers

 

    • Article

 

    • 12/15/2021

 

    • four mins to examine

 

 

In this newsletter

This topic describes hunajatehdas.net the way to update a detachable or in-chassis device’s firmware using the Windows Update (WU) provider.For information about updating machine firmware, see Windows UEFI firmware update platform.

To do that, you will provide an replace mechanism, applied as a tool driving force, that includes the firmware payload.If your tool uses a seller-provided motive force, you’ve got the choice of including the firmware update logic and payload for your present function driver, or imparting a separate firmware update driving force package deal.If your device makes use of a Microsoft-provided driver, you must offer a separate firmware replace driving force package deal.In both instances, the firmware update driver package ought to be prevalent.For extra information approximately everyday drivers, see Getting Started with Windows Drivers.The motive force binary can use KMDF, UMDF 2 or the Windows Driver Model.

Because WU cannot execute software, the firmware update motive force should hand the firmware to Plug and Play (PnP) for installation.Firmware update motive force actions

Typically, the firmware update driver is a light-weight tool driving force that does the following:

  • At tool start or in the driver’s EVT_WDF_DRIVER_DEVICE_ADD callback characteristic:
  • Identify the device to which it’s far connected.
  • Determine whether the motive force has a firmware version this is greater current than the version on the firmware currently flashed on tool hardware.
  • If a firmware update is essential, set an event timer to agenda the update.
  • Otherwise, do not anything until the motive force is started once more.
  • During system runtime:
  • If an replace is queued, look ahead to a fixed of conditions to be met.
  • When situations are met, perform the firmware replace at the device.

Firmware update motive force contents

Typically, the firmware update driving force package deal carries the following:

  • Universal Driver INF
  • Driver catalog
  • Function motive force (.sys or .dll)
  • Firmware replace payload binary

Submit your firmware replace bundle as a separate motive force submission.Adding firmware replace common sense to a dealer-supplied driving force

The current feature motive force can enforce the firmware update mechanism, as proven within the following diagram:

Alternatively, if you need to update the feature driving force and the firmware replace motive force one after the other, create a 2nd device node, on which you may installation the firmware update motive force.The following diagram indicates how one device may have separate device nodes:

In this situation, the characteristic and firmware tool nodes need to have specific hardware IDs with the intention to be targeted independently.

There are a couple approaches to create a 2nd tool node.Certain tool sorts have the capacity to expose a second device node on one bodily tool, which include USB.You can use this functionality to create a tool node targetable by way of WU, and install a firmware replace driver on it.Many tool types, but, do no longer allow a single bodily device to enumerate multiple device node.

In this example, use an extension INF that specifies the AddComponent directive to create a device node that can be targeted by way of Windows Update and set up the firmware replace driver on it.The following snippet from an INF document shows how you may do that:

[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 child tool could have a hardware ID of SWC\ComponentDeviceId.When established, this INF creates the subsequent device hierarchy:

For future firmware updates, update the INF and binary report containing the firmware payload.Adding firmware update logic to a Microsoft-furnished driving force

To replace firmware for devices that use a Microsoft-provided motive force, you need to create a second tool node, as shown above.Best practices

  • In your firmware replace driving force INF, specify DIRID 13 to purpose PnP to go away the files inside the motive force bundle inside the DriverStore:
    [Firmware_AddReg]; Store region of firmware payloadHKR,,FirmwareFilename,,"%thirteen%\firmware_payload.bin"

    PnP resolves this location while it installs the tool.The driver can then open this registry key to determine the location of the payload.

  • Firmware replace drivers have to specify the following INF entries:
    Class=FirmwareClassGuid=f2e7dd72-6468-4e36-b6f1-6488f42c1b52
  • To discover every other device node, the firmware driver should stroll the device tree relative to itself, not by way of enumerating all device nodes for a fit.A consumer can also have plugged in more than one times of the tool, and the firmware motive force should handiest replace the tool with which it is associated.Typically, the tool node to be located is the parent or sibling of the tool node on which the firmware driver is mounted. For example, inside the diagram above with two tool nodes, the firmware update motive force can search for a sibling tool to discover the feature driving force.In the diagram right now above, the firmware motive force can look for the figure device to locate the number one tool with which it desires to communicate.
  • The motive force ought to be strong to multiple times of the device being at the machine, likely with more than one specific firmware variations.For example, there may be one instance of the tool that has been linked and up to date numerous instances; a trendy tool may also then be plugged in which is several firmware versions vintage.This manner that country (which include modern model) should be saved towards the tool, and not in a international vicinity.
  • If there may be an present approach to replace the firmware (EXE or co-installer, for instance), you could in large part reuse the update code within a UMDF driver.

 

Leave a Reply

Your email address will not be published.