nRF5 IoT SDK  v0.9.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Bootloader IoT DFU

By default, the DFU bootloader will start the application on the device. DFU Swap mode is started if indicated in Pstorage Settings. The Pstorage Settings contain a variable that defines if a new valid application, SoftDevice, or bootloader is present in the flash memory.

Note
The IoT DFU Bootloader is based on the current DFU solution proposed in nRF52 SDK.
Once the application is programmed, the bootloader assumes the application is valid. Flashing an application for the first time in DFU mode is not necessary, as it is in SDK DFU.

Memory layout

When implementing a mechanism to perform a Device Firmware Update, be aware where the different firmware components are located in the device memory.

The following figure displays the default memory layout of a 512 kB nRF52 device:

iot_dfu_layout_boot_nRF52.svg
Figure 1. IoT Bootloader Memory Layout

SoftDevices have different sizes. For example, the s1xx-iot-prototype3_nrf52 ends at 0x0001F000. The following table shows the memory layout on a 512 kB nRF52 device with the s1xx-iot-prototype3_nrf52:

Memory range Usage
0x0007D000 - 0x00080000 DFU Bootloader and data
0x0001F000 - 0x0007D000 Application code, free/swap, and application data
0x00003000 - 0x0001F000 SoftDevice
0x00000000 - 0x00003000 Master Boot Record (MBR)
Note
Bootloader IoT DFU is smaller than the standard SDK DFU. Size has been reduced from 16 kB to 8 kB of flash memory.

During system start-up, the Master Boot Record (MBR) will determine the start address of the bootloader by checking the address that is defined at UICR.BOOTLOADERADDR. See nRF52 SDK bootloader documentation for information on how to change the start address of the bootloader.

The MBR will then initiate the bootloader. During initialization, the bootloader will either enter DFU swap mode to swap the old firmware with the new one (specified in Pstorage Settings) or request the SoftDevice to start the application. The application is located right after the SoftDevice, so the SoftDevice is aware of its start address.

Firmware updates can be performed only as a dual-bank update. For more information see the nRF52 SDK bootloader documentation.

Bootloader project

The example project of Bootloader for IoT DFU can be found in the following folder:
<InstallFolder>examples/iot/iot_dfu_bootloader

Note
The bootloader has to be present to successfully swap an old firmware image with a new one.