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

Merging OTA DFU example

Hi, 

I am setting a nrf52832 for an OTA DFU using BLE. I am on windows.

After managing to run the Secure DFU Bootloader following the getting started , I am trying to merge the Secure DFU Bootloader's content to my main application.

I was wondering what is the best way to do this merge ? From the example to my code, from my code to the example, or either of these options ?

When trying to merge the example in my code, I am down to these 4 errors for which I couldn't find the way to deal with. 

It seems to be related to the private_key. I have used the same that I used for the example, which worked..

Thanks for your help

Jerome

  • Normally the Secure DFU Bootloader is set up as a completely different project to your own Application.

    The Bootloader would manage safely updating your separate Application project.

  • Hi,

    Thanks for your answer! I didn't mention in the first post that I am using SES.

    I now understand that it should remain a different project. 

    Want I want is to be able to perform DFU over BLE whenever needed. For that, I cannot be flashing the bootloader manually like I did for the example. That raises me the following questions : 

    Should I include the Bootloader in my project as an additionnal load file (like it is done for the SoftDevice) ?

    Should I include it as a .hex the same way we do for a softdevice ?

    Do I have to attribute a specific memory segment ? 

    Is there any documentation that support the procedure ? 

    Regards, 

    Jerome 

  • Much more complicated process to support what you want to do ... mostly thinly mentioned/documented.

    I would recommend just using nrfjprog to program in the Bootloader and Softdevice, since you presumably will not be changing that too much.

    Instead of having the SES project do an additional load of the Softdevice, you would change it to load a CRC settings.hex file. You need to create this settings.hex file on the fly via a post-linker operation. This put's the newly built Application CRC calculation into a specific area that the Bootloader reads.

    Lastly if you are using SES versions > 4.18 you have to do the workaround mentioned in this issue:

    https://devzone.nordicsemi.com/f/nordic-q-a/39261/nrfutil-generates-wrong-crc/253607#253607

  • My suggestion above is a bit off topic from your question. My suggestions was how to support code development and flash programming using SES.

    With your Bootloader / Softdevice installed, you should be able to DFU over BLE.

    But you do need to consider a way to "enter" DFU mode ...

    If no Application is programmed in the device, the Bootloader will stay in DFU mode automatically.

    If a valid Application is programmed into flash, then you need to know how you will enter DFU mode.

    You may need to modify/configure Bootloader to support a button press entry method upon power up.  If you want to allow a running Application to exit to the Bootloader/DFU, you need to support that process within your application. This could coded to be via a button operation, or via Nordic's "buttonless" DFU BLE service.

    Documents don't give a lot of bottom-line info, but they are there. It all works nicely once it is up an running.

  • Thanks for your help! I got other questions regarding buttonless DFU for which I started another post here.

Related