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

nrf52 serial DFU file loading sequence

Hi,

I have implemented the Master Serial DFU to send my bootloader.bin , application.bin file and Softdevice.bin files.

I'm facing with updating these file.

I want to know is there any sequence to load these file. Which one goes first and next.

Details:

I have created 3 different packages with bootloader , application and softdevice using below commands. once the 3 packages are generated.

I'm merging 3 packages .dat file and .bin files one after the other and uploading to nrf52 in one go.

is this a right way to update the nrf52?

Need to reset the nrf52 after each file update?

Please help me to understand this and how i can update my 3 files.

BTapplication
>nrfutil.exe pkg generate --hw-version 52 --application-version 1 --application bt_app_42994.hex --sd-req 0xAF --sd-id 1 BTApp_pkg.zip

BTBootloader
nrfutil.exe pkg generate --hw-version 52 --bootloader-version 1 --bootloader bt_bl_42981+.hex --sd-req 0xAF --sd-id 1 BTBoot_pkg.zip

BTSD
>nrfutil.exe pkg generate --hw-version 52 --softdevice s132_nrf52_6.1.0_softdevice.hex --sd-req 0xAF --sd-id 1 BTSD_pkg.zip

Thanks,

Basava.

  • Hi,

    With nrfutil you can create one distribution packet that contains softdevice+bootloader and application, but the update needs to be performed in two rounds. First the you upload a merged binary of the softdevice and bootloader , then the application. The update sequence is illustrated in the documentation here.

    nrfutil.exe pkg generate --hw-version 52 --application-version 1 --application bt_app_42994.hex  --bootloader-version 1 --bootloader bt_bl_42981+.hex --softdevice s132_nrf52_6.1.0_softdevice.hex  --sd-req 0xAF  --sd-id 1 sdblapp.zip

    Best regards,

    Vidar

  • Hi,

    Thank you for the reply.

    Now I have created package. It has two .bin  files (bt_app_42994+.bin and sd_bl.bin )  and two .dat files(bt_app_42994+.dat and sd_bl.dat).

    Please let me know which is the right procedure to write all files.

    Procedure A:                                                                                   Procedure B:

    1. Write sd_bl.dat file                                                                      1. Write sd_bl.dat file

    2. write sd_bl.bin file.                                                                      2. write sd_bl.bin file.

    3. Write bt_app_42994+.dat  file                                                     3. Reset the device.

    4. Write bt_app_42994+.bin  file.                                                    4.Write bt_app_42994+.dat  file

    5. Reset the device.                                                                        5.Write bt_app_42994+.bin  file.

                                                                                                             6. Reset the device.  

    can  e merge package file with sequence in one file and load it. Like  Procedure A: ?

    Is it required to reset the device  after loading one .dat and one .bin file Like Procedure B:?

    Thanks and regards,

    Basavanagouda.

  • Adding to above question.

    1. Is it possible to load each file separately? (Bootloader, application and softdevice).

    2. We want upload only SD file or bootloader file and application file base on the requirement. Is it possible to load any one file any time?

    3. We Dont want to combine files and dont want load all files at same time. Is this possible?

    Thanks 

    Basava.

  • Hi Basava,

    1. Generally yes, the bootloader does not impose any restrictions on this, but see my second answer.

    2. As long as they are API compatible. That is, you can't do a major version upgrade of the softdevice without updating the application image. Major softdevice updates will have breaking API changes and/or change size, hence requiring the app to be re-compiled with new API headers and probably linked with a different start address. 

    3. Yes it should be possible.

    Goudra said:
    Please let me know which is the right procedure to write all files.

    The bootloader will reset itself during the activation process of the new images. So it should not be necessary for the DFU controller to issue a reset command between uploads (a new upload is started when you send the init packet).

    Best regards,

    Vidar

    EDIT: Forgot to add that the bootloader must be merged with the softdevice image if you do a major softdevice update and the bootloader includes the BLE transport layer.

Related