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

nrfutil problem - cannot generate correct CRC

Hi Nordic,

Sorry if I missed and repeated a question, just point me to the previous answer if it has been posted before.

I am trying the DFU example found in the SDK example nRF5_SDK_13.0.0_04a0bfd\examples\dfu\ble_dfu_send_hex\test_images_update_nrf52832

Do note that I only used the files from the example provided, none of my own code so far...

First I tried the following steps:

  1. Flashed dfu_test_bootloader_s132.hex using nRFgo Studio

  2. Flashed dfu_test_softdevice_s132.hex using nRFgo Studio

  3. Used Android nRF Toolbox to program dfu_test_softdevice_s132.zip

  4. So far so good ( the example files work)

Next:

  1. I tried to generate a .zip file using nrfutil.exe, using the provided dfu_test_softdevice_s132.hex (I assumed the generated zip file should be identical to dfu_test_softdevice_s132.zip)

  2. I get an error message when trying to upload using Android nRF Toolbox. It says CRC error. NOTE that this error is displayed even before the uploading starts (no progress bar seen).

  3. I did a Diff comparison between my .dat file and the .dat file that worked. The last 2 bytes are different. Some other bytes are different too.

  4. I tried a variety of settings for the version parameters, but still the same outcome.

  5. The generated .bin file is identical though. So is the manifest file

  6. If I replace the .dat file with the one from the example, it works fine

  7. I also tried updating to the latest nrfutil version 3.2.1 but its still the same

So... what am I doing wrong here? How is it possible that the CRC is different even if the binary file is identical? Am I missing some CRC algorithm setting?

Below is the command line I used. I based the settings on the original .zip file (using nrfutil pkg display):

nrfutil pkg generate --softdevice dfu_test_softdevice_s132.hex --key-file private.pem --hw-version 0x0034 --sd-req 098,0xCAFE mypackage.zip

Also tried to ignore the SD version using:

nrfutil pkg generate --softdevice dfu_test_softdevice_s132.hex --key-file privat e.pem --hw-version 0x0034 --sd-req 0xfffe mypackage.zip

I have attached the files I used. Thanks in advance

  • Just to inform that the problem has been solved. I actually thought that by using the option --key-file I was sending the public key along with the init data. After I copied the public key into the source code of the bootloader, compiled and used it, DFU programming works fine.

  • Hi Cidron,

    I am getting same remote invalid crc error can you guide me or provide some information step by step for my problem. I have search lots of but until unable to find solution. As your application same my application i want update my own firmware using DFU via Mobile apps. Could you provide to me your code for reference. I am flash test example as given in sdk 13.1 is working fine. but when i create my own application zip file is not work. Let me know sir...

    Thanks in Advance...

  • Hi Vishal I can't share my code due to non disclosure agreements, but here are the steps you need to do:

    1. Generate a private key using nrfutil.exe
    2. Generate the public key based on the private key you generated earlier, using nrfutil.exe
    3. You will need to build the project at "examples\dfu\bootloader_secure_ble". That is the bootloader.
    4. The project contains a dummy public key which must be replaced with your public key. Otherwise it spits out the bad CRC error (although I am not sure this is an accurate description of the error)
    5. You will also need to download some external dependencies such as uEEC in order to build the project

    The bootloader should work now. Remember to generate the .zip package using the correct private key. Good luck

Related