nRF5 SDK v11.0.0
DFU state machine
This information applies to the following SoftDevices: S130, S132, S332

The firmware update process has been modelled as an event-driven state machine, with each event signifying a specific DFU procedure. The events and procedures are agnostic of the transport protocol that is in use. Therefore, it is possible to perform a firmware update using any transport protocol. The DFU controller can trigger the events by sending a corresponding message on the DFU transport.

The following figure illustrates the transitions in the state machine:

DFU_state_machine.svg
State machine transitions in the DFU process

The entry point of the state machine is the bootloader starting up and entering DFU mode. During initialization, the selected transport layer is initialized. When an update process has been initiated, the DFU prepares the non-volatile memory region for the new application.

The following messages initiate transitions:

Message type Description
dfu_init Initialize the Device Firmware Update module.
dfu_image_size_set Set the DFU image size.
dfu_init_pkt_handle Receive the init packet to be used for safety-checking as descibed in Safety-checking the image.
dfu_init_pkt_complete The complete init packet has been received; execute the safety check for the first step of the DFU process.
dfu_data_pkt_handle Receive a portion of the new application.
dfu_image_validate Trigger validation of the new application.
dfu_image_activate Activate the transferred image after validation has successfully completed.
dfu_sys_reset Reset the device. A reset can occur at any time, for example if a bootloader time-out occurs or when triggered by an external message.

Documentation feedback | Developer Zone | Updated