nRF5 IoT SDK
v0.9.0
|
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.
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.
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.
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.
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.