nRF5 IoT SDK
v0.9.0
|
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.
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:
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) |
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.
The example project of Bootloader for IoT DFU can be found in the following folder:
<InstallFolder>examples/iot/iot_dfu_bootloader