This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 DFU Service without bonds working and not with bonds

Hi,

We are developing an application requiring the DFU Service on nRF52832.

The implementation of the DFU Service without bonds works very well, but when switching to required bonds, we have an issue when the DFU write request is send (0x01 value to the Secure Buttonless DFU characteristic).

The log report: <error> app: SOFTDEVICE: ASSERTION FAILED when writing to the characteristic.

A step by step debug led us to on_ctrlpt_write(&p_auth_req->request.write) call in ble_dfu.c before crashing.

To make the switch, we change the application and bootloader sdk_config.h files as following:

Application sdk_config.h:

// NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table.
#ifndef NRF_SDH_BLE_SERVICE_CHANGED
#define NRF_SDH_BLE_SERVICE_CHANGED 1
#endif

// NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds.
#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS
#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 1
#endif

Bootloader sdk_config.h:

// NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table.
#ifndef NRF_SDH_BLE_SERVICE_CHANGED
#define NRF_SDH_BLE_SERVICE_CHANGED 1
#endif

// NRF_DFU_BLE_REQUIRES_BONDS - Require bond with peer.
#ifndef NRF_DFU_BLE_REQUIRES_BONDS
#define NRF_DFU_BLE_REQUIRES_BONDS 1
#endif

I did not see any other post related to this issue, did we miss something in the config files when going from without bonds to required bonds ?

Regards,

Parents
  • Hi Bertrand, 

    To test buttonless example with bond, you would need to generate a bootloader setting page and flash it in addition to the bootloader and the application. 

    It's described here.

    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.

    I have some additional explanation here as well. 

  • Hi Hung Bui, thank you for the fast answer.

    Actually I thought that it wouldn't work without bootloader settings, even without bonds (at least because of the CRC check at boot). So we already generate bootloader settings page, and we usually flash a merged .hex containing app + BL + freshly generated settings page.

    Is there a difference for generating bootloader settings page with or without bonds ?

    Regarding our issue, which happens as soon as we write the DFU Service characteristic:

    - Without bonds we get log information that the characteristic has been written (from the app_shutdown_handler, and from the blu_dfu_event handler, which are implemented following the DFU buttonless application template)

    - With bonds we don't get any of this log information. It seems that the app has crashed before

    Regards,

Reply
  • Hi Hung Bui, thank you for the fast answer.

    Actually I thought that it wouldn't work without bootloader settings, even without bonds (at least because of the CRC check at boot). So we already generate bootloader settings page, and we usually flash a merged .hex containing app + BL + freshly generated settings page.

    Is there a difference for generating bootloader settings page with or without bonds ?

    Regarding our issue, which happens as soon as we write the DFU Service characteristic:

    - Without bonds we get log information that the characteristic has been written (from the app_shutdown_handler, and from the blu_dfu_event handler, which are implemented following the DFU buttonless application template)

    - With bonds we don't get any of this log information. It seems that the app has crashed before

    Regards,

Children
Related