nRF5 IoT SDK v0.9.0
Application IoT DFU

Table of Contents

The Application IoT DFU exposes a common API for the following tasks:

Currently the following operations are allowed:

Creating the firmware packages is described in Create DFU images.

Creating a merged binary of the application and SoftDevice has to be in the correct order. The SoftDevice must be first and then the application with word size alignment between.

Initialization

Application initialization of the IoT DFU requires a call to the iot_dfu_init function with a parameter for the application callback.

Through this callback, the user is notified of either an error in the IoT DFU procedure or success (if writing to the flash went well). The second event has been created to allow data flow control in the upper layers (such as TFTP) and waits for the flash operation to finish.

Note
The IoT DFU module does not hold any state, meaning the application must ensure that only one firmware is written concurrently.

Writing the new firmware

The IoT DFU module uses IoT File to perform a write operation to flash memory. The module is the owner of the correct file abstraction and the application may request a handle for it by calling the iot_dfu_file_create function.

The sequence chart below presents an example of writing new firmware to the flash memory.

msc_iot_dfu_write
Figure 1. Write procedure

Validation

After the new firmware is written to flash memory, a validation procedure might be called. It includes two verification actions:

The information about the downloaded firmware has to be passed using the Firmware Description structure.

Applying the new firmware

The last operation of Application IoT DFU is to apply the correct settings for the bootloader and perform a software reset after which the bootloader context will swap firmware according to the given settings.

The sequence chart below presents the last operation of IoT DFU that involves validation and applying the new image.

msc_iot_dfu_apply
Figure 2. Apply procedure


This document was last updated on Tue Dec 1 2015.
Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone.