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

BLE_Secure DFU-OTA in SDK 15

HI Nordic,

I am trying to add OTA-DFU feature to my application. I am able to perform DFU, however the DFU is not working properly always.

First I flash the softdeivce and bootloader using nrfgo studio. Then I flash my application using the DFU feature. My application is loaded and running successfully. After that, when again try to perform DFU, the DFU operation is getting stuck. It goes through following operations - 

Starting DFU (Initializing DFU process)

Starting Bootloader (Waiting for bootloader)

Device Firmware Update (Update in progress),

and gets stuck in 

Connecting (Connecting to...)

The DFU is performed successfully only after mulitple resets. And there is no pattern as such. Sometimes it works after 3-4 tries. Whereas it won't work even after trying for more than 10 times.

I followed following steps to perform DFU -

Bootloader

In the configuration, enabled the DFU Buttonless enter. Compiled the bootloader code with my own public key. Flashed the bootloder using nrfgo studio.

Application

Added the DFU relevant code snippets and libraries from the blE_app_buttonless DFU example. ENabled the DFU reated flags in the pre-processor directive. Enabled BLE_DFU in the sdk_config.h

Compiled the code and generated the zip file using nrfutil.

Performed DFU using nrf_connect.

Is there any configuration settings or code changes to be made, other than that in the ble_app_buttonless_DFU example.. 

Regards

Parents
  • try this,when it stuck go to scan again in phone it may advertising as dfutarg(mac id change by 1 digit),now dfu new code

  • Hi abhijit,

    Thanks. 

    As you said, I tried to perform DFU by using DFUTARG. The DFU transfer is done successfully.

    However isn't there a cleaner way to do it. In this case, we have to always close the app and perform DFU in the second attempt.

  •  Are you using nrf connect for mobile or nrf connect for pc? Have you taken a look at this blog post

    I have just tested the complete setup & was able to update the application from buttonless dfu to a ble_app_blinky using an nrf52dk.

    Did you make sure to follow the documentation provided here carefully? Are you trying the process with bonds or without bonds? Did you remember to generate a bootloader settings page & merge it with the bootloader hex file?

    There is also some very useful information provided in the blog post I linked to related to buttonless dfu. 

    Could you provide a sniffer trace of the dfu update process?

    It could be useful to merge the bootloader, bootloader settings page, softdevice & buttonless dfu app using mergehex. When I tested, I merged all four hex files together. I would either program the nrf52 via nrfjprog or the nRF Programmer app, as nrfGoStudio is deprecated.

     It could also be a useful idea to test the buttonless dfu app first like provided in sdk 15 to make sure that you are doing all of the steps correctly before integrating the functionality into your custom app.

  • HI Bjorn,

    I am using nrf_connect for mobile, and I have gone through the Blog post and the documentation you have shared.

    I am using nrfgo studio for flashing the softdevice and bootloader. Can you emphasis on, why we should avoid nrfgo studio..

    I am creating zip packet for the application only, as mentioned in the blog post.

    I am yet to test the buttonless DFU code. However, I integrated the all the relevant code snippets/libraries and configuration settings in my application while adding the DFU feature. I will anyway test the buttonless DFU example and let you know. 

    .Thanks :-)

  • The main reason you should not use nrf go studio is because it is deprecated. If you run into an issue, we will most likely tell you to try nrf connect. :) You can most likely get it working with nrf go studio, but it is always best to use the newer programming methods if possible (i.e. nrf connect or nrfjprog). The newest version is the programmer app in nrf connect. Good luck! Slight smile

Reply
  • The main reason you should not use nrf go studio is because it is deprecated. If you run into an issue, we will most likely tell you to try nrf connect. :) You can most likely get it working with nrf go studio, but it is always best to use the newer programming methods if possible (i.e. nrf connect or nrfjprog). The newest version is the programmer app in nrf connect. Good luck! Slight smile

Children
No Data
Related