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

OTA DFU: CRC Error Fixed after re-program bootloader

situation:

We are developing an nRF51 application with OTA DFU. we use SDK 9.0.0 and the DFU bootloader version is v8. We have prepared different two packages. Single OTA DFU works with the each package. Other conditions are as follows:

  • IC: nRF51822 CEAA
  • softdevice: s110
  • bootloader: built ourselves based on SDK 9.0.0 example with gcc
    • Difference with example code: RAM layout, GPIO pin layout, Clock source to internal, BLE Tx power
  • OTA DFU packaging: pc-nrfutil
  • Controller of OTA DFU: iOS nRF Toolbox

symptoms:

  • When we try OTA DFU with one package after other package is already updated, CRC error is responded. And OTA DFU does not work any more even with the first package.
    • works: Package A -> Package A -> Package A -> ...
    • works: Package B -> Package B -> Package B -> ...
    • not works: Package A -> Package B, not work any more even with A
    • not works: Package B -> Package A, not work any more even with B
  • After erase the all images and re-program bootloader via JLink, we can use OTA DFU.

Because of this symptoms, we can update the firmware only once with OTA. Do you have any ideas?

Parents
  • Ran into a similar issue here.

    As GlennEngel noted, the issue is related to erasing the swap area. And as R. Kawajiri noted replacing pstorage_platform.h with an example resolved his issue. The confluence of these observations revealed that pstorage_size_t is important when attempting to use pstorage for large data blocks. The bootloader examples properly define it as uint32_t, but many of the application examples use uint16_t. You'll need something like this in your bootloader pstorage_platform.h:

    typedef uint32_t pstorage_size_t;      /** Size of length and offset fields. */
    

    Thanks for pointing the way, all.

  • This worked for me too.l A much cleaner fix than mine. Hopefully Nordic has some mechanism to update all their examples with the correct pstorage_size_t definition!

Reply Children
No Data
Related