When using nrfutil to upgrade the app for 52840dongle, you can see the data shown in the figure through the USB analyzer. The highlighted one does not quite understand the meaning. A total of 69 bytes.I would like to ask the specific meaning, what should we send here if we make the tool for upgrading the application ourselves?And why is there a suffix of 0xC0 at the end of each piece of data? Not in the official documentation.
Meng. said:Not in the official documentation.
That is not true: DFU serial protocol description, second sentence:
"The transport layer uses the SLIP library for encoding and decoding packets."
Hi Turbo J，thanks for your response.
I found my problem, 0xC0 is the end of the packet.
The transfer is compliant with the SLIP library.
But what does the instruction I highlighted mean?
0x08 = NRF_DFU_OBJECT_WRITE
That (and the following 7 Bytes transaction) is the init packet with the metadata for the update.
Thanks Turbo J.
What does this initial packet with metadata for update consist of?
We want to know how to organize this data.
As Turbo J said, the DFU protocol is described on nrfutil (see the link in his first reply).
Are you refering to the 21 22 23 ... packets? I am not sure, but it looks like generic "USB - set up connection" packets.
I am talking about the data drawn by the red circle as shown in the figure, and the red circle in the lower right corner is the full version of the first packet of data.
Then, as Turbo J said, the protocl is described here.
What happens here is the transfer of the init packet. When this is done, and the CRC is calculated and it is executed, then the next step is to do the same with the firmware image, according to the message charts.
So the line with the red circle is 08: Write, and the rest is payload for the init or application image (in this case init, if it is near the start), except the "C0", which is part of the SLIP library.
I recommend that you read the DFU Protocol documentation and the Serial documentation, both the "Initialization", "Transfer of init packet" and "Tranfer of firmware image" sections.
As I said at the beginning.
I read the DFU Protocol documentation and the Serial documentation, but I didn't find anything about the init packet.
The above only said the init packet, but did not say what the specific content is.
The init packet is created using nrfutil. You should use nrfutil to create these packets. nrfutil is open source.
The content isn't really well documented, but here are some approaches. The init packet is the .dat file in the zip file that you generate using nrfutil. You can generate init packets with different settings, and see what changes. E.g. set the application_version to different values, and see the differences in the .dat file.
Here is a brief overview of the fields in the init packet:
Also, take a look in the nrfutil repo on github.
Basically, you don't need to know what's inside the init packet, which is why this information isn't floating around. You need to know that you generate it with nrfutil, and that you transfer the init packet first, and then the application image. If you need more info on what the init packet contains, please refer to the nrfutil repo documentation and implementation.