ext: lib: mcumgr: Fix slot-1 image upload deadlock condition
If a firmware update is attempted with a corrupt image and a power outage or
reset occurs while the bootloader (mcubooot v3.1 in this case) is erasing the
corrupt image then slot-1 can be left in a state where mcuboot has not
properly released slot-1 and a DFU transfer can no longer happen. Attempts
to upload will transfer 0 bytes as the trailer at the end of the slot remains
present and indicates the slot is 'in use' blocking the slot erase operation
on reception of the 1st image block or a image erase command.
This commit fixes this issue by adding a addition requirement that a slot is
'in use'. The additional requirement is that the image header magic value
located at the beginning of the slot is also present. If this additional
requirement is not also met then the slot is considered not 'in use'.
Signed-off-by:
Nick Ward <nick.ward@setec.com.au>
Loading
Please sign in to comment