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

DFU OTA for Custom Application

Hi,

I have implemented a custom application(Lets name that file app.hex) which works and sends the data to phone via BLE on my nrf51822 DK. I am using the s110 v8 softdevice(Lets name it sd.hex). I followed the tutorial for DFU OTA and compiled the project "dfu_dual_blank_ble_s110_pca10028.uvprojx" to generate the dual blank DFU hex file. (Lets name it dfu.hex) Firstly I erased my development kit IC completely from nRFgo Studio. Programmed the softdevice, sd.hex file on the board. Then I compiled and burned the chip with "dfu_dual_blank_ble_s110_pca10028.uvprojx" directly from my Kiel platform. I was able to detect the "DfuTarg" from the Nordic nRF Toolbox App in phone.

Following the INIT file generation mentioned in the pdf here, I was able to create a zip file(with just the application specs) which I could load onto the phone and reprogram the firmware with app.hex, successfully with the zip file .

So as of now, DFU over BLE was possible for me.

Here is the problem, I cant seem to program app.hex with dfu.hex from the Nordic nRFgo Studio. Here is my current procedure in sequence.

  1. Program the sd.hex from Nordic nRFgo Studio.
  2. Program the dfu.hex from Nordic nRFgo Studio.
  3. Program the app.hex from Nordic nRFgo Studio.

The problem is even after doing all the above steps, the DK is still advertising with the name "DfuTarg" although I have programmed it advertise with a different name in the app.hex (I have verified app.hex separately to see its advertising name and it works correctly)

So my question is how do I burn the app.hex with a dual blank bootloader first time(which can be later reflashed with say app2.hex, although I have figured out this issue of OTA DFU from phone)?

Parents
  • This is in the documentation for the DFU bootloader. When you erase the chip it clears out the flag which tells the bootloader there is a valid application, so when you put it back, it doesn't know there is a valid application so it goes into bootloader mode. Once you have loaded the app once via DFU, the flag is set and it will boot into the application.

    I believe the DFU documentation specifically says that if you have DFU on the chip, you can no-longer load application code any other way. That's not entirely true, once you've got it going once, you can load it from nrfstudio because the flag stays set, as long as you don't wipe out the bootloader or erase the chip.

    The other option is to go find the location in memory it writes the flag, and go write that flag yourself.

Reply
  • This is in the documentation for the DFU bootloader. When you erase the chip it clears out the flag which tells the bootloader there is a valid application, so when you put it back, it doesn't know there is a valid application so it goes into bootloader mode. Once you have loaded the app once via DFU, the flag is set and it will boot into the application.

    I believe the DFU documentation specifically says that if you have DFU on the chip, you can no-longer load application code any other way. That's not entirely true, once you've got it going once, you can load it from nrfstudio because the flag stays set, as long as you don't wipe out the bootloader or erase the chip.

    The other option is to go find the location in memory it writes the flag, and go write that flag yourself.

Children
Related