Important: Before you run this example, make sure to program the SoftDevice .
The Buttonless DFU Template Application is an example that includes the functionality of doing buttonless DFU using the hardware delivered in the nRF5 Development Kit.
The application includes the three services in the Heart Rate profile:
When the application starts, the Board Support Package is initialized. Next, the buttonless DFU service is initialized.
When notification of DFU control point characteristic is enabled, and the value 0x01 is written to it, the device will disconnect, send the event BLE_DFU_EVT_ENTERING_BOOTLOADER , and enter the bootloader.
- Note
- It is recommended to have security enabled on the DFU characteristic.
- This application is not power optimized!
- The application will stop advertising after 3 minutes and go to system-off mode. Push Button 1 to restart advertising.
Setup
You can find the source code and the project file of the example in the following folder:
<InstallFolder>\examples\ble_peripheral\experimental_ble_app_buttonless_dfu
Button assignments: BSP BLE Button Assignments
Testing
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 by performing the following steps:
- Compile and program BLE Secure DFU Bootloader .
- Compile the Buttonless DFU Template Application.
- Transfer the application over BLE as described in BLE Secure DFU Bootloader .
- Observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Connect to the device from nRF Connect (the device is advertising as 'Nordic_Buttonless'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
- Observe that the services are shown in the connected device.
- Enable the service by writing '01 00' to the Client Chacteristic Configuration (0x2902).
- Write '01' to the control point and observe that the device enters bootloader mode (LED 3 is on).