I'd like to update a firmware which is essentially made of 2 parts, say 0x1000-0x8000 is a "read-only" part and 0x8000-0x50000 is a "read-write" part. If I flash this firmware using with DFU, the bootloader will store the full size (0x4f000) and the associated CRC to its bootloader settings (last page of the flash 0xff000). If the firmware modifies itself (between 0x8000-0x50000) the bootloader will refuse to boot it because the CRC does not match. I'd like to tell the bootloader to only check the 0x1000-0x8000 prefix.
My current workaround is to do 2 updates:
- First the full firmware from 0x1000 to 0x50000.
- Then the prefix from 0x1000-0x8000.
Is there a better solution where I only need to do the DFU once?