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

Extending application of SDK 12.3 for legacy buttonless DFU

Hello,

I need to develop an application for nRF51822 that uses SoftDevice 110 v8.0.0 using SDK 12.3 and extend it to use buttonless DFU for the legacy DFU bootloader of SDK 10/11. I've successfully added S110 v8.0.0 to SDK 12.3 and have its ble_app_uart example building and working well using Segger Embedded Studio 4.18 on macOS (on nRF51 DK).

The DFU bootloader of 12.3 is the newer secure bootloader, so instructions/examples for extending an application for buttonless DFU are for this newer secure bootloader. A couple tickets (here and here) state that it is possible to port the legacy DFU service and related libraries from SDK 10/11 to SDK 12.3.

The guide for extending an app for buttonless DFU in SDK 11 state that the application must use Device Manager. I understand that Device Manager was removed in SDK 12.x and replaced with Peer Manager. I'm a bit lost on how to go about this. Adding buttonless legacy DFU support to an application in SDK 10/11 relies on:

bootloader_util_arm.c in nRF51SDK1000dc26b5e/examples/dfu/experimental_ant_bootloader/
dfu_app_handler.c in nRF51SDK1000dc26b5e/components/libraries/bootloader_dfu
ble_dfu.c in nRF51SDK1000dc26b5e/components/ble/ble_services/ble_dfu

Adding buttonless DFU (secure) support to an application in SDK 12.3 relies on:

ble_dfu.c in
nrf_dfu_settings.c

I've tried approaching this a number of different ways, all unsuccessful so far. Before providing details, thought I would ask for some initial guidance. General steps for extending the ble_app_uart application of SDK 12.3 with S110 v8.0.0 for buttonless legacy DFU.

Many thanks,

Tim

  • While I did not get the above working, I've found a solution. I can DFU the bootloader of SDK10.0 with S110 v8.0.0 to Simblee, then I can DFU a new application that uses:

    #define BOOTLOADER_DFU_START 0xB1

    ret_code_t err_code; err_code = sd_power_gpregret_set(BOOTLOADER_DFU_START); APP_ERROR_CHECK(err_code); sd_nvic_SystemReset();

    to reset into DFU mode. As per this ticket, I had to modify bootloader source to remove the init_softdevice check from ble_stack_init():

    //if (init_softdevice)
    
    //{
        err_code = sd_mbr_command(&com);
    
        APP_ERROR_CHECK(err_code);
    //}

    So the first update of Simblees in the field is two-step. First, DFU bootloader and S110. Unfortunately the chip hangs after this, but hard reset (power off/on) causes it to start in DFU mode. Then DFU new application.

    Future updates of the application require that our iOS application connect to the peripheral, send a message so the application then executes the above code. Device enters DFU mode, then iOS app proceeds with DFU of new application.

    The good thing is that we end up with a bootloader on Simblees that we control.

    Thanks for help along the way. Very much appreciated.

    Tim

Related