nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Creating a DFU bootloader

The SDK provides some example projects that implement a bootloader with Device Firmware Update (DFU) capabilities, which can receive a firmware image and copy it to the nRF51 IC to replace the current bootloader, SoftDevice, or application.

The examples support the following Device Firmware Updates:

  • Updating the SoftDevice.
  • Updating the bootloader.
  • Updating SoftDevice and bootloader in a single operation.
  • Installing or updating an application.

Before updating the device firmware, make sure that the following prerequisites are fulfilled:

  • SoftDevice S110 v7.0.0 or later is installed on the IC.
  • If the register UICR.CLENR0 has a size value (for example 0x00016000) and you are updating the SoftDevice, the new SoftDevice must not be larger than the current SoftDevice.
  • When updating the SoftDevice, the bootloader, or SoftDevice and bootloader, the flash size of the target device must be 256 kB. When updating or installing an application, the flash size can be 128 kB or 256 kB.

If the device has an existing application when performing a SoftDevice update, the application is erased. Transferring a bootloader or application using dual-bank mode (see Dual-bank and single-bank updates) preserves the current image until the new image is copied, validated, and activated.

To get started, program and test one of the provided example projects. Running the BLE bootloader example describes the process for the default example, which uses BLE transport. Alternatively, you can run an example that uses serial transport (see Running the serial bootloader example).

The SDK provides sample images that you can use to test the DFU process. Creating an image file explains how you can convert your own image into the correct format.

The examples include a method for ensuring that the uploaded image is valid. See Safety-checking the image for information on how to ensure that only valid images are accepted.

If you encounter any errors, check the Troubleshooting section.