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

Updating one nRF52 DK board with another nRF52 DK board automatically via OTA DFU

I am trying to update on nRF52 DK board with another, separate nRF52 DK board using OTA firmware updates. Essentially, I am trying to replicate how the nRF Connect Desktop app flashes firmware onto these boards.

Here are the steps that I want to conduct:

  1. "First" nRF52 scans for "second" nRF52.
  2. If "second" nRF52 is present and advertising, connect to it.
  3. After connection, check for Buttonless Service.
  4. If service exists, send "second" nRF52 to DFU mode.
  5. "First" nRF52 will wait for "second" nRF52 to disconnect, then reconnect after it begins advertising again.
  6. "First" nRF52 will transmit the firmware update to "second" nRF52.
  7. "First" nRF52 will disconnect after the firmware update is successfully sent.

The dfu_transport_ble.py example provides a lot of this functionality. However, I am stuck on how to get the firmware image onto the "First nRF52" before the transmission begins.

I found a post asking a similar question that was posted in 2018, however, this post only mentions that the image needs to be stored on the DK, not how to actually do it.

Any help would be greatly appreciated.

Parents
  • Hi,

    Nordic does not provide any code example on how to do this. You need to store the whole image (bin file + init packet/.dat file from the dfu .zip image) on the DFU master and send that to the nRF being upgraded. Exactly how you transfer and store this on the DFU master is up to you and could depend on your specific requirements. (Depending on the size of the image it could also be that you would need to store it on external flash rather than the internal one).

Reply
  • Hi,

    Nordic does not provide any code example on how to do this. You need to store the whole image (bin file + init packet/.dat file from the dfu .zip image) on the DFU master and send that to the nRF being upgraded. Exactly how you transfer and store this on the DFU master is up to you and could depend on your specific requirements. (Depending on the size of the image it could also be that you would need to store it on external flash rather than the internal one).

Children
  • I had a feeling that this was the case.

    That being said, the dfu_transport_ble.py defines a function 'send_firmware' as follows:

    def send_firmware(self, firmware):


    In this function, how is the "firmware" passed to the function? Is it via the local path to the firmware on my system (PC)?

    Is there an example that uses the dfu_transport_ble.py in any capacity that I can use as a reference?

  • Hi,

    This implementation is from nrfutil, which is a python script running on a PC. All the DFU logic etc is on the PC, and the nRF is only used as a BLE connectivity device using the pc-ble-driver. The upgrade image is stored on a PC in this case and never resided on the nRF.

    If your use case is to have a computer connected, and run the DFU process from there, this is useful. If not, then you cannot reuse anything, though you can look at the DFU master implementation as a reference for how you would implement it on the nRF.

Related