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

Repeatedly performing OTA with updated firmware

Hi,

I have the NRF52 dev kit with NRF522832 chip. I am using SDK version 15.2 and the Segger IDE. I am trying to do OTA programming and have used this tutorial:

https://devzone.nordicsemi.com/nordic/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader

I have taken the sample ble_blinky_app in the examples and my own code and this is what I tried out:

1. Generated the private and public key with nrfutil.exe.

2. Used the secure_dfu_bootloader in examples\dfu\secure_bootloader. Mine is the PCA10040 chip so I am using the code in pca10040_ble. I am able to program the bootloader and the dev kit broadcasts DfuTarg.

3. I compiled both blinky app and my own code with the private key and generated two different .zip packages.

4. I used the NRF Connect app to connect to the dev kit DfuTarg and did OTA programming with the DFU button that appears once you connect. The blinky app was programmed and I tested it out.

5. I then tried to reprogram the kit through OTA. This time the kit broadcasted "Nordic Blinky" as the blinky app was programmed. This time I could not find the DFU button. How do I reprogram through OTA when there is another application already programmed?

6. I had to erase the blinky application and reprogram the DFU bootloader in order to perform OTA programming.

How can I repeatedly perform OTA programming? The rest of the tutorial talks about combining bootloader, application and soft device. Do I have to do this? I am having a tough time trying to figure out what exactly I need to do to achieve repeated OTA programming capability.

Thanks in advance.

Parents Reply Children
  • Thanks for the answer. I will continue with that tutorial and get back to close the ticket.

  • Hi,

    I went through the ble_app_buttonless_dfu example and prepared my code with it. It compiles without error, but when I try to flash the device and execute the code in my Segger IDE, it halts at NRF_BREAKPOINT_COND; in app_error_weak.c. So I backtracked and compiled the original ble_app_buttonless_dfu without any changes and I still get this error. Will this app work without any changes or are there some mandatory changes I need to get the app working? I erased the device and tried to flash but same error.

    Thanks in advance,

    Shiv

  • Hi Shiv,

    So I backtracked and compiled the original ble_app_buttonless_dfu without any changes and I still get this error.

     Did your flash the bootloader first? The app will not run unless the bootloader is present. You can also set NRF_LOG_BACKEND_RTT_ENABLED to '1' in sdk_config.h and compile the "Debug" target to get the crashlog in SES debug terminal. 

    Select debug target:

    Edit: you also need to generate the bootloader settings page. Otherwise, the bootloader will not boot the application but stay in DFU mode. 

  • Hi,

    I flashed the DFU bootloader and made sure through NRF connect that it was broadcasting DfuTarg. I then compiled the original ble_app_buttonless_dfu and created the application .zip with nrfutil. I was able to do a DFU upload OTA and this time I saw the broadcast change to "Nordic Buttonless".

    However, I did not generate the bootloader settings. If I saw the broadcast change to "Nordic Buttonless" does that mean the bootloader booted the application?

    Thanks again,

    Shiv

  • Hi,

    You only need to generate the settings page when you are flashing SD+BL+APP with the programmer and want the bootloader to start the application (in production for instance).

    The bootloader will manage the settings page when you upload the application through DFU. 

Related