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

DFU

I want to make a burn file, but I get an error when merging hex files. : “The hex files cannot be merged since there are conflicts.”,When I cancel the compilation of the nrf_dfu_settings.c, the resulting hex can be merged smoothly. So what is the reason? What is the use of this  nrf_dfu_settings.c ?

sdk 12.2

Thanks!!!

  • Hi,

    This turns out to be a known bug in nRF5 SDK v12.2.0, where the (experimental) buttonless DFU hex file contains a register in the UICR. It was fixed for nRF5 SDK v13.0.0, as part of other changes where nrf_dfu_settings.c was no longer needed. However in the buttonless DFU example in SDK 12.2.0 some of the functionality in nrf_dfu_settings.c is still needed.

    A manual fix for the hex files is to remove the following two lines from the application hex file:

    :020000041000EA
    :0410180000E00700ED

    (But keep them in the bootloader hex file!)

    There is also a permanent fix. The register is set lines 69 through 89 in nrf_dfu_settings.c. (Starting with a brief stating "This variable makes the linker script write the mbr parameters page address to the UICR register(...)" This code must be included when building the bootloader. The code must be excluded when building the buttonless DFU application. I propose that you set a define BOOTLOADER in the bootloader project, and surround the mentioned code lines with "#ifdef BOOTLOADER" / "#endif".

    I also recommend you to read through release notes for later SDKs up to the point where the buttonless DFU example is no longer experimental, and see if there are other bugs or issues that are relevant for you.

    Regards,
    Terje

Related