Skip to content
Commit 4c1c1732 authored by Nick Ward's avatar Nick Ward Committed by Anas Nashif
Browse files

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: default avatarNick Ward <nick.ward@setec.com.au>
parent 17e2618f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment