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

Merging of Boot loader, DFU and BLE peripheral application.

Hi,

I have created my BLE peripheral application with custom services. Now i want to add DFU feature to it.

I have independently checked DFU test images given in nRF5 DK which works fine.

I want my application to update (DFU) whenever there is new firmware update , currently example DFU firmware updates to application firmware once and then i cannot again update it to new application firmware.

I am now stuck how to do this.

Secondly how to merge my BLE application and DFU and bootloader. Should i need to rewrite the firmware in example DFU  or add DFU , bootloader code to my application. ?

Can i create a new project and add only necessary libraries with softdevice?

Regards

Sudhir Foujadar

Parents
  • well first of all let me check your question

    your application works fine your dfu works fine you combine them both and it still works fine

    and after using dfu update the application you cant update again?

    that is because there are three diff section in your devices


    --dfu bootloader(which updates happen here)

    --application(with setting pages)

    --softdevices

    so if you have three "functional" section which means all of those sections work fine

    when you restart the app it will just boot into the application section you cannot directly update your app in this section

    now you have three different way to change your section while you are in the application section


    1. use buttonless dfu which can detect the signal to force the device to change the section to bootloader

    for buttonlesswith interactive command as example:(nrf52840)

    devzone.nordicsemi.com/.../merging-interactive-command-and-buttonless-dfu-base-on-sdk-_17-0-2

    2. delete the setting pages and restart(this method is one way and no going back) after restart it will force enter bootloader forever
    before you update your setting page
    example: nrf52840:
    devzone.nordicsemi.com/.../force-enter-the-dfu-with-command


    3.use button or command in uart to tell device you want to change the section

    well , if  asking how to enter with button i think the sdk have already taught that

    second with command in uart for me 

    as interactive command as an example:

    in cli_m.c file

    NRF_CLI_CMD_REGISTER(dfu,
        NULL,
        "dfu start.",
        dfu);
    static void dfu(nrf_cli_t const *p_cli, size_t argc, char **argv) {
      NVIC_SystemReset();
      ble_dfu_buttonless_bootloader_start_finalize();
      //NVIC_SystemReset();
    }

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    for your second question how to merge your application with softdevice and dfu and setting page

    it is simple after you build your program you should create a hex file all of those above does have hex file in sdk just merge them

    in command 

    @ECHO ON
    mergehex -m softdevice.hex bootloader.hex -o softdevice+dfu.hex
    @ECHO ON
    mergehex -m softdevice+dfu.hex setting.hex -o softdevice+dfu+setting.hex
    @ECHO ON
    mergehex -m softdevice+dfu+setting.hex application.hex -o full_application.hex

Reply Children
No Data
Related