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

Is there an nRF51822 DFU master source code ?

I'm trying to upload via DFU from one nRF51822 to another nRF51822 via DFU

The receiving side is not a problem as there there are loads of examples.

But I can't find any code where the nRF51822 acting in a central role sends data to a DFU device (another nRF51822)

Does anyone know if there is any source code for this ?

Parents
  • I am afraid that we do not have an example where another Nordic device that sends DFU data to another Nordic device.

    I think the closest thing we have is the nRF OpenMesh, but this uses a custom DFU implementation and not the Nordic DFU Service.

    If you want to use the Nordic DFU Service and the Nordic apps to perform the DFU, then you will have to create an application that forwards packets sent to the DFU Control Point and the DFU Packet characteristics.

    -Bjørn

Reply
  • I am afraid that we do not have an example where another Nordic device that sends DFU data to another Nordic device.

    I think the closest thing we have is the nRF OpenMesh, but this uses a custom DFU implementation and not the Nordic DFU Service.

    If you want to use the Nordic DFU Service and the Nordic apps to perform the DFU, then you will have to create an application that forwards packets sent to the DFU Control Point and the DFU Packet characteristics.

    -Bjørn

Children
  • OK. Thanks for the answer.

    I guess I do not need to be the same DFU protocol that the Nordic App sends, but it would have been better if it was, as it would be more flexible.

    I'll take a look at the OpenMesh code - is it this github.com/.../nRF51-ble-bcast-mesh ?

    Thanks

    PS.I may investigate Serial DFU instead, as that may be another option for the device I am working with (a Smartband)

  • No, as I mentioned in my answer you only have to forward the DFU packets, but I agree that it would be convenient if one could use the same protocol. Unfortunatley, that is something that we do not have at the moment.

    Yes, github.com/.../nRF51-ble-bcast-mesh is correct. I forgot to add the link in my answer.

  • I'm not sure what you mean by forwarding DFU packets

    I was hoping to develop a device that enumerated as USB Mass Storage, which would search for devices in DFU mode then upload the data from the mass storage via DFU

    The USB device could be a DFU device, but I don't know if there is a standardisation for a USB DFU device, like there is for HID or Mass Storage

    Mass Storage is the easiest to implement, as I already have code to implement this on a STM32F103

    So I would just need to add some code to send the incoming mass storage data to the nRF51 which re-transmits it to the device waiting for DFU data.

    But, I was hoping not to need to write the DFU transmission code from scratch on the nRF51 (DFU master)

  • Oh, I was of the impression that you wanted to update a device using smartphone via another device. We dont have an example for what you mentioned in your last comment, but you can use our existing DFU Profile to achieve this. Which charactersitics that should be written to and when they should be written to is explained here Infocenter page.

  • Thanks Bjorn

    I think the DFU profile is what I was looking for. But I was hoping that there was an example of the master (central) side of this transfer.

    I will search the web e.g. github in case someone has already written some code to do this, as it looks very hard to debug. as I'd need to run debuggers on both the Master and Slave side

    (I have 2 JLink's but it would still not be easy to setup, as I suspect I would end up needing to use 2 difference PCs for debugging - one where the DFU bootloader code had been compiled and flashed and one where the master / central DFU code had been compiled)

    Perhaps I should look at the Android or iOS toolbox code, as this seems to be the only source code for the master / central side of things - even though I want that code to run on the nRF51822 its self

Related