This is my first DFU project, and so this may be super-obvious to all of you.
I am writing this here to help others, because it appears that there are others out there right now struggling to get DFU working.
- The SDKV11 dfu_init_template.c is written assuming that a crc is used to validate the image, with a suggestion that there is lots of flexibility to do other things.
- When using GCC as the dev environment, one is naturally led to use the PC-NRFUTIL python utility on github.
- One immediately learns that the "master" branch isn't compatible with SDK11. It's clearly a work in progress for what's going on in SDKV12. By doing research, the suggestion is that the "0_5_1" branch was the thing to use. (I looked at the other branches, and I don't see an alternative; perhaps I'm wrong.)
- If you build your image using that version of NRFUTIL, you immediately find that the manifest does not have a CRC in it. (You'll also find that the init packet is so large that it requires bumping the buffer size in both dfu_single_bank.c and dfu_init_template.c from 64 to 128. But I digress.)
- When you get your DFU code working and get to dfu_init_postvalidate(), you find that the CRC in the init packet simply isn't there. It looks as though it's replaced with the ext_packet_id.
I don't see any discussion on this forum that points to a version of dfu_init_template.c that can be used to verify the firmware_hash rather than crc. Perhaps I didn't look hard enough.
For now, I disabled the CRC check, and my DFU (finally) works perfectly.
I don't know how long it will be until SDKV12, but I'm looking forward to seeing the new methodology.
Thank you to those of you out there who gave helpful comments while trying to get DFU working; I do very much appreciate it.