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

Background DFU (Application DFU) Support for APP+BL+SD

Nordic,

We have added Background DFU(Application DFU) in our code and it works for App update.
Now i want to add support for Softdevice and Bootloader update in this. Will it ever be possible to perform bootloader and softdevice update through the application?

Config:
MCU          : nRF52840 (So, We have enough space in Bank 1 to store both bootloader and Softdevice also space for App(We can store all three App+BL+SD in Bank 1))
SDK           : SDK15.3 and SDK16 (Currently we use both SDK in our product)
Softdevice : ANT_s340_nrf52840_6.1.1 (SDK15.3)
                  : s140_nrf52_7.0.1_softdevice (SDK16)

As per the current bootloader code SD+BL supported "#define NRF_DFU_BANK_VALID_SD_BL 0xAC".


Now my question is,
1. What should be the changes required in booloader code (or in Application code) if i want to perform all BL, SD and APP using Background DFU?
2. If this is not possible then what is the reason.

Please give appropriate solution for the same.

Thanks in advance,


Regards,
Sandip Divani

Parents
  • Hi Sandip, 

    Could you give more information about the solution you are having now regarding background DFU. I assume that it worked for updating APP ? Did you base your background DFU on any of our example ? What modification have you added to the bootloader ? 

    I don't see a big problem doing what you described. The way it work for us right now is that we assume most of the application wouldn't have enough space for updating BL+APP+SD at once. It may not be true if you use our flag ship nRF52840 with large flash size. So what we do in our DFU solution now is to do it in 2 phases, first updating BL+SD, in this phase the original application will be erased. And phase 2 is when the new BL running and we will update the new APP. 

    In your case, you can send BL+SD+APP at once. What you need to do is to modify the Bootloader so that it will accept the combination of SD+BL+APP. And then after update SD and APP from the image, it update it self. I am thinking of modify the code that handle SD+BL update so that instead of just replacing SD it will replace SD+APP, just need to increase the size of the SD image so that it cover the APP as well. The updating BL will be the same as in the original BL, use the MBR to update BL.

    So, what need to be modified is to add an extra combination to the type list (in dfu-cc-pb.h and in dfu-cc.proto). Add the handling of that type of combination in bootloader. Add the combination in nrfutil to generate .zip file as well. 

    Another option I am thinking of that doesn't requires modification of the bootloader is to combine the SD and APP in to one image. And trick the bootloader thinking that it's updating SD+BL. The SD and APP will be treated as a single SD image and be copied the same as SD+BL update. I haven't test this option, but I think it worth a try. If this work, you don't need to do any modification to the bootloader. 

  • Hi Hung

    thanks for your reply.

    Another option I am thinking of that doesn't requires modification of the bootloader is to combine the SD and APP in to one image. And trick the bootloader thinking that it's updating SD+BL. The SD and APP will be treated as a single SD image and be copied the same as SD+BL update. I haven't test this option, but I think it worth a try. If this work, you don't need to do any modification to the bootloader.

    but this is not work directly

    We have make changes in bootloader code and do this in other way.

    Regards,
    Sandip Divani

Reply
  • Hi Hung

    thanks for your reply.

    Another option I am thinking of that doesn't requires modification of the bootloader is to combine the SD and APP in to one image. And trick the bootloader thinking that it's updating SD+BL. The SD and APP will be treated as a single SD image and be copied the same as SD+BL update. I haven't test this option, but I think it worth a try. If this work, you don't need to do any modification to the bootloader.

    but this is not work directly

    We have make changes in bootloader code and do this in other way.

    Regards,
    Sandip Divani

Children
No Data
Related