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

Detailed DFU Application Interface Documentation

I need to implement DFU in a Unity3D application. I have tried to integrate the Android SDK library that you have on github. They are not integrating very well.

I have a lot of BLE experience and if I understand exactly the steps to implement sending a ZIP file payload over the DFU service and characteristics then I could probably do it without your library. This would also be good because I need this to work on iOS as well and being able to do it myself in C# code would be great because then I don't have to do native code for each.

The problem is that the documentation all assumes you are using the library you have provided.

Is there anything special that the library does? Does it actually break open the ZIP file and send the different parts over or does it just open a connection and send the ZIP file and have the firmware on the Nordic part do the work? If the previous then I would like to know the simple commands to implement that.

Parents
  • A detailed description of the DFU protocol can be found in the bootloader section of the infocenter.

    Here is a very coarse overview:

    The app opens the zip file and sends the meta information first (which the bootloader can choose to say "nope" to), then the binary firmware data in chunks, checked via CRC32. Once the last checksum is OK, the command to "execute" the update is sent.

  • I have been reading through the bootloader section in infocenter and am still not clear on exactly what to do.

    Maybe I am looking in the wrong place. Just to be clear I am working on SDK 15.3.

    Most of the information I am finding looks to be from the device side and not the mobile app.

    Can you give me some specific pointers? It would be nice to have a detailed description of 1. send these bytes, 2. expect this response or 2, 3. Now send these bytes, etc.

  • I found DFU BLE transport in the SDK documentation to be sufficient in order to be able to implement a DFU host for another language.

    Another solution: Read the source code on github...

  • Well, I will give it a try.

    What I am not sure about is when to send what and what to expect back. I notice my zip file has a bin object and a dat object. The bin object is obviously the firmware. No idea what the dat object is.

    The packet sequence charts show sending 06 01 and getting back 60 06 01 with max size, offset and crc. Well, do I send the 06 01 for the bin or dat or both? How can the 60 06 01 contain a CRC when I haven't given it any data yet?

    Then it says to send 01 01 as a create command, but only if there isn't an init packet. How do I know if there is an init packet or not?

    The questions go on. Where can I find answers?

    I have been looking at the github software, but there are so many different files and everything is so layered and abstracted.

    I can probably figure it out eventually, but have a time limit and would appreciate some help in making this more clear.

  • How can the 60 06 01 contain a CRC when I haven't given it any data yet?

    The idea of the DFU protocol is to be able to continue an update when an error occurred. This can save a lot of time when you e.g. have a disconnect at 90% transferred data.

    You always get a value for the CRC back - it is just not valid in the case where the was no previous data/command object transferred.

    The conditions when to do what are specified in the message sequence charts.

Reply
  • How can the 60 06 01 contain a CRC when I haven't given it any data yet?

    The idea of the DFU protocol is to be able to continue an update when an error occurred. This can save a lot of time when you e.g. have a disconnect at 90% transferred data.

    You always get a value for the CRC back - it is just not valid in the case where the was no previous data/command object transferred.

    The conditions when to do what are specified in the message sequence charts.

Children
No Data
Related