Hi,
I'm trying to create a DFU controller on a secondary board, and have been referencing the info center and nrf toolbox android app to get started. I've run into an issue where the dfu controller does not compute the same CRC as the app/dfu target.
For example, I'm using nRF5_SDK_17.0.2, and when I send the hrs_application_s140.zip package (examples\dfu\secure_dfu_test_images\ble\nrf52840) through the toolbox app, I see the following CRCs from the app log messages.
In contrast, when I try computing the values on the DFU controller (unzipped .dat and .bin file), I see the following CRCs.
The fact that I am successfully computing the CRC for the init packet, as well as the first 4096 bytes of the firmware image lead me to think it's not a problem with the actual CRC function I am using. Additionally, if I use an online CRC calculator (https://crccalc.com/), it gives me the same CRC results as the test code on my DFU controller when taking 4096 bytes at a time. What do I need to do in order to get the data CRC's to match?
Here's the code I am testing with on the secondary board for reference. It opens the firmware bin file, then splits it into chunks by reading 4096 bytes at a time. The CRC of the 4096 bytes is then calculated. The loop stops after 2 iterations just for testing purposes since all other CRCs after the first 4096 bytes do not match.