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

DFU Post Validate Fails at CRC16

Hi guys,

I've almost got DFU working on SDK10. However I am having issues at post validation of the image, specifically in the function dfu_init_postvalidate() in file dfu_init_template.c. In this function the CRC passed from the init file is compared to the locally calculated CRC via a crc16_compute() call. However this function does not seem to return a matching value. I know the init file has the correct the CRC of my image and it is correctly passed to the bootloader. However every time, the locally calculated CRC does not match (incorrect). I could easily bypass this step, but I'd rather keep it for an image integrity check.

If directly DFU the .hex file without .zip generation via NrfStudio I see that nrfStudio sends the same CRC calculation as my .zip file. So the only possible source of error is in the local crc16_compute() . How is crc16_compute() different from the way nrf.exe calculates the CRC? Has anyone faced this issue?

Thanks guys,

DC

Parents Reply
  • This is bizarre because they are definitely returning different results on the same image. I tested calculations but at Bank 1 and Bank 0 in case something occured during the swap. It occurs when the image is encrypted. The nrf.exe calculates the same CRC as nrfStudio on the encrypted image. But the crc16_compute() does not seem to calculate the correct CRC. This suggests that the functions you mentioned are difference in how they calculate.

Children
No Data
Related