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

NRf51822(Beacon) OTA DFU by using nrf51822(Reader)

Hello everyone,

We want to do nRF51822 OTA DFU by using another nRF51822 only. we have done OTA DFU with help of example given in SDK and with help of mobile app(nrf toolbox) .but now we wanted to use a micro controller(nRF51822) to do this job .

The application we are designing is having Beacon(nRF51822) and a Reader(nRF51822) and we want to update the firmware of Beacon by using Reader(which is also a nRF51822) for which we need OTA DFU.

Please help us by providing any example code for this purpose or by giving clarity on this complete process by which we will be able to do it . thank you.

  • Hi Sachin, 

    We unfortunately don't have an example showing DFU master via BLE yet. What we can suggest is to refer to the Android/iOS DFU module we have and follow what we did there. 

    Another source is the DFU library, either in Master Control Panel if you are using legacy DFU C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel\3.10.0.14\lib\dfu

    or the dfu module in the nrfutil if you are using secure DFU: https://github.com/NordicSemiconductor/pc-nrfutil/tree/master/nordicsemi/dfu

    It's not too complicated, I would suggest you have a look at the documentation and implement on your own. 

     

  • Hii, thanks for your quick reply.

    I am having more doubts in this process like, when we try to perform OTA DFU by using nrf toolbox what we exactly do is, by providing hex file and other details of that application to nrfutil finally nrfutil generates out a zip package which is need to be transfer to mobile storage, and then we need to select out this zip package in to nrf toobox app and select out device then it gets transfer to Nrf51822.

    So doubt is how should i need to send this file to my beacon by using Reader for DFU over the air?

    Do i need to store this zip folder somewhere and then need to read and transfer this file?

    Or else i only need to transfer a hex file which is generated by compiling the application?

    if so where should i save this file, in to my reader or else i need to connect any storage module for this file and then read out and transfer ?

    Not having any clarity what to transfer and how to transfer to beacon...

  • Hi Sachin, 

     

     The .zip file consist of mainly 2 files, the init image (.dat file) and the application image file ( let's talk about application update first, not bootloader/softdevice) .bin file . 

     

    When you are doing DFU from an nRF52 Master you don't need to use the .zip file but to use the .dat file and the .bin file. 

    You need to find a way to store the two files either in the nRF52 Master's internal flash or in external flash , it's up to you. 

    If you plan to use internal flash, you can define a certain address in flash to store the init image, and other place to store application image. 

    Then you can use Jlink commander to write the image into the nRF52 Master internal flash using loadbin command. Here is the example instruction (in this we use 0x9000 and 0x10000 respectively): 

    In J-Link commander, type the following commands, this is for writing application, the similar applied for softdevice/bootloader just choose the right location  :

    1. connect
    2. <Select nRF52832 and select SWD interface>
    3. loadbin init_packet.bin 0x9000
    4. loadbin app_image.bin 0x10000
    5. r
    6. g

     

     

    Then when doing DFU the nRF52 Master will read flash and send first the init data (.dat file) and then the application image file (.bin file). 

    When and how to send the init data and application image file is described in the documentation for DFU in the SDK as I provided in last reply. 

Related