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

CRC problem in my customize DFU Controller (nrfutil)

Hi,

For some reasons, I would like to write my own application for updating the firmware, something like NRFUTIL application.

I wrote it and everything is working fine but in case of CRC failure my target device stuck somewhere and I should restart it manually to continue updating from the last part.

For updating the firmware first I send select command and get the last offset and CRC and if CRC is correct I can continue updating without any problem, but in case of CRC failure, I do not know what should I do to remove the last object that I create. I tried to send Execute command but it is not working.

I think I should send a special command in case of CRC failure to clear the last object which causes the CRC failure but I do not know what is this command!

So could you please let me know what should I do to fix this issue?

Thank you in advance.

  • Hi,

    It should be sufficient to issue a new NRF_DFU_OP_OBJECT_CREATE() request. According to the documentation, this will reset the progress since the last Execute command.  

    Best regards,

    Vidar

  • Thank you for your answer.

    I did this but unfortunately, it is not working. 

    when I get CRC error, I execute NRF_DFU_OP_OBJECT_CREATE() function but it is still not working.

     

    the problem is that after I get CRC error I call NRF_DFU_OBJECT_OP_SELECT and for example it returns this array:

    06, 01, 00, 10, 00, 00, c1, 7f, 00, 00, 75, 1d, c3, e5, c0, 

    but it should be:

    06, 01, 00, 10, 00, 00, 00, 70, 00, 00, 47, 91, 6c, b0, c0, 

    the CRC of the 0x00007fC1 is not correct but for 0x00007000 is correct.

     

    when I reset the target manually it is working and I get the second array which is the correct answer.

  • nta_xyz said:

    the problem is that after I get CRC error I call NRF_DFU_OBJECT_OP_SELECT and for example it returns this array:

    06, 01, 00, 10, 00, 00, c1, 7f, 00, 00, 75, 1d, c3, e5, c0, 

    This was not the result I expected. When you get the CRC error, do you send NRF_DFU_OP_OBJECT_CREATE() followed by NRF_DFU_OBJECT_OP_SELECT()? Another option may be to simply resend the init packet command, this should let you restart DFU the upload. 

  • I think finally I found the problem!, the problem was when I got the CRC error, I started sending from the beginning of the firmware again!, but I should send data from the last correct offset.

    now it is working in all situations. 

    Thank you for helping me.

Related