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

How to generate a Bootloader + Softdevice + Application zip for OTA updates/DFU.

Hello,

For OTA updates or DFU I want to create a zip file that contains the Bootloader, Softdevice, and Application into one, But when I generate this through nrfutil.exe and update it with the nRF Toolbox I only see that the application is updating. When updating the screen of the application starts at 2/2, so I assume that the bootloader and softdevice are skipped.

For more information I use the nRF52832 chip and I use the SDK 15.0.0. version (which uses the s132_nrf52_6.0.0_softdevice). The code I use to generate the zip is:

nrfutil pkg generate new_DFU.zip --hw-version 52 --sd-req 0xA8 --sd-id 0xA8 --softdevice softdevice.hex --bootloader-version 0 --bootloader bootloader.hex --key-file key_node.pem --application-version 0 --application application.hex
What am I missing? What am I doing wrong?

  • I want to have one zip containing the BL + APP, but this isn't possible. A zip containing BL + SD + APP is possible. So my reasoning is if I use the combined zip with BL + SD + APP to be able to update the BL and APP in one zip.

  • Under the hood it will be the same that the process will need to be done in 2 phases. One is to update SD+BL (or BL) and after that is to update the Application.

    But please clarify what exactly happened after  you do the update, would the new application running or not ? 

    Please first try to update SD+BL in one .zip and then update APP after that in another .zip to separate the process make it easier to debug. 

  • sorry for my late response, I couldn't do the testing due that some colleagues were on holiday.

    It seems that the SD+BL zip doesn't seem to update due to a FW version failure. I am currently using this line to generate the zip:

    nrfutil pkg generate SmartClip_SB.zip --hw-version 52 --sd-req 0xA8 --sd-id 0xA8 --softdevice softdevice.hex --bootloader-version 0 --bootloader bootloader.hex --key-file key_node.pem
    Can I only update the SD if I have a newer version? Is there a way to evade this?

    All I want is a way to update the BL + APP in one zip.

  • Hi, 

    I'm sorry for late response. When you update Softdevice if it's the same version there is no point of updating it and the bootloader will reject that. 
    If you want to update BL+APP in one zip you have three option: 

    - Edit the bootloader to accept BL+APP and handle them properly. This requires you to modify the bootloader. 

    - Use one zip which include two DFU zip files inside one for BL and one for APP. In your DFU master app you unzip that file and then do 2 DFU update one for BL and one for APP. This doesn't require you to rewrite the DFU part of the DFU master app. I think this requires the least modification. 


    - Use one zip for both BL+APP. You need to modify the DFU master app to open the zip file and then open the init packet for application and send application image, after that do the second DFU to open the init packet  for bootloader and send the bootloader. This requires you to modify the DFU part of the DFU mastar app a bit so that it will take the the init packets, images from same .zip file. 

  • sorry for my late response, I was gone due to holiday.

    For case 1: Are there guides or examples for this modification. I followed the getting started guide on the DFU which doesn't help my situation.

    For case 2: The NRF52832 is connected with Bluetooth to a tablet with or own application and requires a specific command to go into DFU mode. This means that after one update the device is out of the DFU mode and is disconnected from the tablet, thus a whole procedure needs to occur that reconnects the NRF52832 with the tablet for the second update. This reconnecting procedure can cause quite a confusion for some clients which we want to avoid, that is why I want to combine both the BL + APP into one zip to make the whole update proces streamlined. 

    For case 3: In my experience the bootloader needs to be updated first after the application or else the application will brick itself. In addition we designed our application with flutter and it uses the flutter-nordic-dfu library, I don't believe that this library is that flexible and that altering it wil cause issues in the long term.

    So to my understanding there is currently no easy way combine the BL + APP into one zip for the DFU update.

Related