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

DFU on NRF52

Hello,

Has someone been able to use DFU with nRF52 device?

I'm trying to add the DFU capability/service to the HRM example. I have added the BLE_DFU_APP_SUPPORT define, and included the following 3 files to the project:

bootloader_util.c dfu_app_handler.c ble_dfu.c

When I compile I get this error:

............\components\libraries\bootloader_dfu\dfu_app_handler.c(153): error: #136: struct "" has no field "BOOTLOADERADDR"

It seems that the BOOTLOADERADDR (UICR) is not defined in nrf52.h

Thanks!

Parents
  • Most of the DFU stuff should be functional for the nRF52 in SDK 0.9.2, but not all. The HRM example project does not include project files using DFU (though the code is there when you define BLE_DFU_APP_SUPPORT as you did). The reason for this is probably that there is some work left there, but unfortunately the documentation does not reflect this.

    There will be a new SDK release that addresses this at some point, but for now you can try to work your way around it.

    After you have added the missing files to the project and defined BLE_DFU_APP_SUPPORT, you have to modify line 146 and 153 in components\libraries\bootloader_dfu\dfu_app_handler.c.

    In both those lines you should replace NRF_UICR->BOOTLOADERADDR with *(uint32_t *)(0x10001014).

    I have not tested this, but it should work.

  • Thanks! It is working now.

    Is there a way to flash the application and the bootloader on the device in one go? Instead of flashing the bootloader and then do a first DFU with the application.

    I'm just thinking that in production line this may be annoying since we need an extra step to do the first DFU.

    Thanks

Reply Children
No Data
Related