1 Microchip Device Firmware Update (MDFU) Protocol Overview

Many embedded system designs require a mechanism to update a processor’s firmware using a standard communications bus (UART, I2C, SPI, etc.).

The Microchip Device Firmware Update Protocol defines a mechanism for updating the firmware of a client processor, using a host processor over different communications busses.

The figure below shows how an MDFU host (either a PC or an embedded processor) is used to transfer a new client application to an MDFU client, running on a client processor. The client firmware update code updates the client application to the new client application that it receives from the host.

More information on terms used in this specification can be found in the Definition of Terms section.

1.1 MDFU Protocol Characteristics and Benefits

The MDFU Protocol provides a flexible mechanism for updating client firmware that is able to accommodate the needs of many embedded system designs while maintaining a small client memory footprint. It is intended to be capable of supporting the needs of a wide range of client microcontrollers, from small 8-bit microcontrollers to large 32-bit MCUs and beyond.

The MDFU Protocol updates client processor firmware using a file transfer approach that is simple, stable, and client processor independent. Client processor specific memory details are contained in the Client Update File and the client firmware update code. The MDFU Protocol commands and responses are client processor agnostic. Hosts discover all necessary client information from the client as part of the update process. These MDFU Protocol characteristics lead to the following benefits:

  • MDFU hosts can update any attached MDFU client processor, if the following conditions are met:
    1. The host supports the version of the protocol the client has implemented.
    2. The host has allocated enough command/response buffer space to support the attached client.
  • Client processor specific features can be supported/added by appropriately defining/modifying the Client Update File contents without modifying the MDFU Protocol or host
  • The simplicity and stability of the protocol reduces version compatibility issues between MDFU hosts and clients

The layering of the MDFU Protocol makes adding support for new communications busses straightforward. It maximizes the reuse of valuable MDFU features across multiple communication interfaces and clearly calls out which details need to be defined for each unique communications interface. Hosts and clients can be written in a way which maximizes code reuse across different communications interfaces and minimizes the effort of adding support for a new communications interface.

The MDFU Protocol provides mechanisms for detecting command/response corruption and contains mechanisms for automatically recovering from detected corruption.

Clients have the option to abort the update process immediately, upon detection of an unrecoverable error, rather than waiting for the entire update attempt to complete before the host discovers the update failure. A mechanism is also provided for clients to report a reason for terminating the update to help developers or users debug any issues.

Clients can also determine if their new firmware is valid and report that status back to the host. Firmware verification algorithms are a tradeoff of complexity, client resources (Flash/RAM/Processing), and corruption detection capability. Each individual MDFU client can select the verification algorithm that is the best fit for their design.

The file transport approach to firmware updates, used by the MDFU Protocol, provides an opportunity to use the same Client Update File format and Client Update File processing code for both hosted firmware update use cases and non-hosted firmware update use cases, i.e. Over The Air (OTA) updates.

1.2 MDFU Protocol Layers

The MDFU Protocol allows updates to be performed over different physical communication busses. To help facilitate the definition and operation of the MDFU Protocol over these various communication busses, the MDFU Protocol specifications are organized into two layers.

  • Firmware Update Protocol Layer
    • The Firmware Update Protocol Layer defines protocol details that are reused by every communications interface.
  • Transport Layer
    • The MDFU Transport Layer definitions specify how MDFU commands and responses are sent over a specific communication bus.
    • Each unique communication bus may have a unique specification of how commands and responses are sent over that communication bus.

1.3 Microchip Device Firmware Update Protocol Version

This document describes the following version of the Microchip Device Firmware Update Protocol.

MajorVersion

0x01

MinorVersion

0x00

Patch

0x00

PreRelease

N/A

Any protocol changes that are not backward compatible with the prior version of the protocol increment the MajorVersion byte. Any protocol changes that introduce new capabilities without breaking backwards compatibility with the prior version of the protocol increment the MinorVersion byte. Updates to the specification which do not change the protocol (such as fixing bugs, improving/clarifying the documentation, fixing typographical errors, etc.) increment the Patch byte. All public releases will omit the PreRelease byte.

1.4 Definition of Terms

  • Host: A processing unit which is used to control the transfer of a Client Update File to a client being updated. This host could be a PC, embedded microprocessor, or microcontroller.
  • Client: The processor whose firmware (memory) is being updated.
  • Client Update File: A file that the host transfers to the client containing information necessary to update the client firmware (memory).
  • MDFU: Microchip Device Firmware Update.