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

nrf52832 serial dfu mode implementation

Hi,

I'm trying to implement nrfutil serial DFU  master in C code. I have few doubts on it.

1. Can we avoid ping packet at the start?

2. What is PNR and how we can use this to send our firmware packet?

3.  What is MTU?  is this really necessary to get a MTU from the device? Can we send fixed number of firmware file?

4.  what is 01 opcode stands for?  what data need to send along with this opcode?

5.I found .dat file in the Zip folder. what it contains and when we need to send this? can we avoid this file?

6. is this 0xC0 is the end of the packet?

7. is there any specific frame format to send packet to board?

8. is this necessary to receive reply back from the device?

9. can we directly start firmware packet from the start. instead for pinging, PNR, MTU packet? 

Please help me to understand above doubts.

Thanks and regards,

Basavanagouda.

Parents
  • Hi Basavanagouda,

    The whole serial DFU flow is shown in the sequence charts for the Serial transport layer.

    1. There is no need to implement the ping packet. It can be useful for testing though, as you can use it to see if you have a working connection with the bootloader on the nRF.

    2. Packet Receipt Notification (PRN) is used to acknowledge packet reception. It is not needed if you are using a reliable link (UART can probably be considered reliable here).

    3. MTU is the maximum transmission unit (think of it as the maximum packet size). It is covered by the serial transport layer documentation. You can set a fixed number as long as you know that it is not too large for the device you are upgrading (which you can know if you are making both).

    4. All opcodes are listed in a table in the DFU protocol documentation.

    5. The .dat file contains the init packet, which is required. This contains version info etc. and is signed. The DFU process will only commence if the init packet validation is successful.

    6. Where do you see that there is always a 0xC0 in the end of an init packet?

    7. The firmware is transferred as raw binary (but split up). So no particular format as such.

    8. PRN is not required.

    9. No.

  • Hi Einar,

    Thank you for the response and its helps us lot.

    6. Where do you see that there is always a 0xC0 in the end of an init packet?


    btbin.htm

    We captures data while sending example firmware from nrfutils to board. Each sent and  rx packets are ending with 0xC0.

    please check the end of the file you can see Blue and red colored data. Blue represents Tx data from the nrfutil and Red is Rx response from the device.

    Thanks and regards,

    Basavanagouda.

  • Hi Basavanagouda,

    That 0xC0 is the SLIP code for identifying the beginning and end of a packet frame. So that is only related to UART over USB.

    Einar

Reply Children
Related