Important: Before you run this example, make sure to program the SoftDevice.
Also, make sure to program the BLE Secure DFU Bootloader.
The Buttonless Secure DFU Service Template Application is an example that shows the functionality of running a Buttonless Device Firmware Update using the hardware delivered in the nRF5 Development Kit.
You can configure this template project to either support bonds or not. If the template project is configured to support bonds, the application will exchange bond information with the bootloader, guaranteeing that only bonded devices are allowed to perform DFU operations.
For more information on the Buttonless Secure DFU Service, see Buttonless Secure DFU Service.
To enable or disable the support of bonds, modify the configuration parameters in the sdk_config
file. For details on editing the SDK configurations, see SDK configuration header file.
You can also use the following config parameters to customize the behavior of your application:
When the application starts, the Buttonless Secure DFU Service is initialized.
nRF52810 limitations:
Due to limited flash size on nRF52810, the following restrictions apply when using this SoC.
The bootloader settings page is required on the device so that it can boot the application. Among other information, this page contains the CRC value and length of the bootable application (if present). This CRC value is calculated on boot-up to verify that a valid application is present.
If there is no bootloader settings page present on the device, the bootloader creates a default version signifying that there is no application available to boot. In such case, the only option for the Secure DFU is to enter DFU mode during boot-up.
Programming a bootloader settings page with information about a bootable application is required for using Secure DFU compiled with bond support. The reason for this is that the Secure DFU bootloader has no functionality to create bonds with a client device and it relies on the main application on the device to do so.
For information on creating a valid bootloader settings page, see Generating bootloader settings.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_peripheral\ble_app_buttonless_dfu
Testing is done by using a pre-generated hex file that contains the following
The hex files available for testing have been compiled with or without bond support.
Test the Buttonless DFU Template Application with the nRF Toolbox app, which is available on both iOS (App Store) and Android (Google Play). You can also test the application with nRF Connect for Desktop by performing the following steps:
This procedure assumes you are using nRF52832 but test images are also available for nRF52840. If you are working with nRF52840, make the following changes: substitute 'nrf52832' with 'nrf52840' and 's132' with 's140' in all paths.
examples\dfu\secure_dfu_test_images\ble\nrf52832\sd_s132_bootloader_buttonless_with_setting_page_dfu_secure_ble_debug_with_bonds.hex
Secure DFU service
is shown in the connected device. Expand the service and observe that the characteristic named Buttonless Secure DFU with bonds
is present. examples\dfu\secure_dfu_test_images\ble\nrf52832\softdevice_s132.zip
. Click Start DFU
.examples\dfu\secure_dfu_test_images\ble\nrf52832\sd_s132_bootloader_buttonless_with_setting_page_dfu_secure_ble_debug_without_bonds.hex
Secure DFU service
is shown in the connected device. Expand the service and observe that the characteristic named Buttonless Secure DFU without bonds
is present. examples\dfu\secure_dfu_test_images\ble\nrf52832\softdevice_s132.zip
. Click Start DFU
.