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

Update app+bootloader without bonds to with bond by dfu in single shoot.

Hello,

we have working both dfu with and without bonds on SDK 15.3.

We started without bond and now we implemented with bonds and would like to update some boards we have distributed to other locations by dfu to the new app and new bootloader with bonds.

The problem is we must update both bootloader and app by dfu, when we try to update both (generate package with all boot+sd+app) it makes the first step 1/2 and disconnect and cannot connect again.

I guess this is due to the new bootloader is flashed (and before 2/2 there is a reset and restart just flashed bootloader) but it cannot proceed to step 2/2 due to there is not bonded device... after a while it resets and then app (old one without bond) starts and hangs up at the starting (due bootlader has bond and app not I guess).

So the issue is I would like to flash both (app+bootloader) at the same time by single hex by dfu or modify the bootloader to do not reset and continue to write app or modify the bootloader to skip some checking in order I can proceed to step 2/2, after that I would re-dfu the bootloader to have the final one.

Is there any way to do it?

If I flash the bootloader+sd+app+settings by external programmer it is working fine, however the other people don't have programmers so I would like to update them by dfu. When I have the new software on the board writting by the programmer I can do dfu with all packages (same as it is already flashed by programmer) using same file and can see steps 1/2 and 2/2, I mean I am sure package for dfu is fine and can flash correctly but when starting point is already a board with bonds in both app and bootloader.

Thks

Carlos

  • Hi Carlos, 

    The problem is we must update both bootloader and app by dfu, when we try to update both (generate package with all boot+sd+app) it makes the first step 1/2 and disconnect and cannot connect again.

    The bootloader will not start advertising if it doesn't have the bonding information so the central will not be able to re-connect for the second part of the update in this case. A possible solution, as you said, is to modify the bootloader to allow update of BL+APP in one go. Or maybe find a way to make the bond requirement dynamic and disable it for just this update. E.g., allow connection without bonding if current app_version stored in bootloader settings is an older version.

     Best regards,

    Vidar

      

  • Dear Vidar,

    thank you for your quick reply.

    This is not for production devices so any method will work for me if can achive the update once of the board.

    I guess "allow update of BL+APP in one go" seems easy one... but can you guide me how to do it? If you can just tell me where is the key place (file, function, etc) to modify it will help me a lot!

    Thks!

  • Dear Carlos,

    I actually think it would be easier to make the bond requirement dynamic. The DFU controller would need to be modified as well to support BL+APP update in one go. I.e, replace NRF_DFU_BLE_REQUIRES_BONDS with a global variable, version check, etc. 

  • Hi Vidar,

    If I understood well, your suggestion is modify code depending on NRF_DFU_BLE_REQUIRES_BONDS inside nrf_dfu_ble-c and nrf_dfu_settings_svci.c to make it always available and choose one path or the other depending on current version, isn't it?

    Would it need also App side or only bootloader?

    Thanks

  • Hi Carlos,

    Carlos said:
    If I understood well, your suggestion is modify code depending on NRF_DFU_BLE_REQUIRES_BONDS inside nrf_dfu_ble-c and nrf_dfu_settings_svci.c to make it always available and choose one path or the other depending on current version, isn't it?

     Yes, it was something like that I had in mind. I have not tried to implement this myself, but I don't think there should be any problems with this approach. You only need to modify the bootloader for this. 

Related