nRF5 SDK v15.2.0
Creating DFU images
This information applies to the following SoftDevice: S132

Tools

nrfutil is a PC tool which allows for creating and signing firmware packages, as well as for performing the firmware update process using a PC. For details on possible ways to install the tool, see nrfutil installation.

Creating a firmware package

Firmware packages for background DFU are created using the same method as in the BLE Secure DFU Bootloader. To find out how to create a firmware package, refer to Creating a firmware package with nrfutil.

To create a firmware image, follow these steps:

  1. Create cryptographic keys for the example. For information about key generation, see Working with keys.
    1. Create a private key.
      nrfutil keys generate priv.pem
    2. Create a public key in code format and store it in a file named dfu_public_key.c.
      nrfutil keys display --key pk --format code priv.pem --out_file dfu_public_key.c
    3. Copy the dfu_public_key.c file to the project folder <InstallFolder>\examples\dfu\dfu_req_handling, replacing the existing file.
      Note
      Do not copy the key to the folder containing your example. Use the path provided above.
  2. Prepare the background DFU client application.
    1. Compile the background DFU client.
    2. Generate a bootloader settings HEX file.
      nrfutil settings generate --family NRF52 --application \<PathToHexFile\> --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex
    3. Use mergehex (part of the nRF5x Command Line Tools) to merge the background DFU client HEX file and the bootloader settings HEX file:
      mergehex -m \<PathToHexFile\> settings.hex -o dfu_client.hex
  3. Prepare the firmware to update.
    1. Compile the new version of the background DFU client.
    2. Prepare a firmware package. For more information, see Creating a firmware package with nrfutil.
      nrfutil pkg generate --hw-version 52 --sd-req \<RequiredSoftDeviceVersion\> --application-version 2 --application \<PathToNewHexFile\> --key-file priv.pem app_dfu_package.zip

Documentation feedback | Developer Zone | Subscribe | Updated