simtrace2/firmware/misc
Eric Wild cb655f9774 firmware: add crc stub to all dfu apps to ensure reliable loading
DFU flashing of apps sometimes aborts, and although rare this leads to
broken devices if no boot button or serial/jtag access exists, because
the bootloader will keep trying to start a half-flashed app that then
crashes at some point.

The easiest fix that works with existing bootloaders is to prepend a
small 512 byte stub that calculcates the crc and compares it with the
crc calculated at build time, and then either starts the actual app, or
sets the dfu flag and resets. This ensures we either have a working,
running app, or end up in the bootloader, ready to flash again.

For obvious reasons this only applies to dfu apps, and not to flash
targets like the actual bootloader itself.

Change-Id: Id6df0486c8b779889d21800dc2441b3aa9af8a5f
2021-12-15 14:04:20 +00:00
..
crctool.c firmware: add crc stub to all dfu apps to ensure reliable loading 2021-12-15 14:04:20 +00:00