Skip to content

Commit ff119bb

Browse files
committed
docs: design: Update description of the swap tables
This commit updates the description of the swap tables, used to determine the type of operation to perform or resume at startup, in order to reflect the changes that were performed in the code to enable the swap-move strategy to support sectors containing both firmware and trailer data. Signed-off-by: Thomas Altenbach <thomas.altenbach@legrand.com>
1 parent cd82e06 commit ff119bb

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

docs/design.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -672,39 +672,49 @@ types described above via a set of tables. These tables are reproduced below.
672672
---
673673

674674
```
675-
State I (swap using offset only)
675+
State I (swap using offset and swap using move only)
676676
| primary slot | secondary slot |
677677
-----------------+--------------+----------------|
678-
magic | Any | Good |
678+
magic | Not good | Good |
679679
image-ok | Any | Unset |
680680
copy-done | Any | Set |
681681
-----------------+--------------+----------------'
682682
result: BOOT_SWAP_TYPE_REVERT |
683683
-------------------------------------------------'
684684
685-
State II
685+
State II (swap using offset and swap using move only)
686+
| primary slot | secondary slot |
687+
-----------------+--------------+----------------|
688+
magic | Good | Good |
689+
image-ok | Unset | Unset |
690+
copy-done | Any | Set |
691+
-----------------+--------------+----------------'
692+
result: BOOT_SWAP_TYPE_REVERT |
693+
-------------------------------------------------'
694+
695+
State III
686696
| primary slot | secondary slot |
687697
-----------------+--------------+----------------|
688698
magic | Any | Good |
689699
image-ok | Any | Unset |
690-
copy-done | Any | Any |
700+
copy-done | Any | Unset |
691701
-----------------+--------------+----------------'
692702
result: BOOT_SWAP_TYPE_TEST |
693703
-------------------------------------------------'
694704
695705
696-
State III
706+
State IV
697707
| primary slot | secondary slot |
698708
-----------------+--------------+----------------|
699709
magic | Any | Good |
700710
image-ok | Any | 0x01 |
701-
copy-done | Any | Any |
711+
copy-done | Any | Unset |
702712
-----------------+--------------+----------------'
703713
result: BOOT_SWAP_TYPE_PERM |
704714
-------------------------------------------------'
705715
706716
707-
State IV
717+
State V
708718
| primary slot | secondary slot |
709719
-----------------+--------------+----------------|
710720
magic | Good | Any |
@@ -715,13 +725,13 @@ types described above via a set of tables. These tables are reproduced below.
715725
-------------------------------------------------'
716726
```
717727

718-
Any of the above three states results in MCUboot attempting to swap images.
728+
Any of the above five states results in MCUboot attempting to swap images.
719729

720730
Otherwise, MCUboot does not attempt to swap images, resulting in one of the
721-
other three swap types, as illustrated by State IV.
731+
other three swap types, as illustrated by State VI.
722732

723733
```
724-
State V
734+
State VI
725735
| primary slot | secondary slot |
726736
-----------------+--------------+----------------|
727737
magic | Any | Any |
@@ -734,7 +744,7 @@ other three swap types, as illustrated by State IV.
734744
-------------------------------------------------'
735745
```
736746

737-
In State V, when no errors occur, MCUboot will attempt to boot the contents of
747+
In State VI, when no errors occur, MCUboot will attempt to boot the contents of
738748
the primary slot directly, and the result is `BOOT_SWAP_TYPE_NONE`. If the image
739749
in the primary slot is not valid, the result is `BOOT_SWAP_TYPE_FAIL`. If a
740750
fatal error occurs during boot, the result is `BOOT_SWAP_TYPE_PANIC`. If the
@@ -746,7 +756,7 @@ rather than booting an invalid or compromised image.
746756

747757
*An important caveat to the above is the result when a swap is requested*
748758
*and the image in the secondary slot fails to validate, due to a hashing or*
749-
*signing error. This state behaves as State IV with the extra action of*
759+
*signing error. This state behaves as State VI with the extra action of*
750760
*marking the image in the primary slot as "OK", to prevent further attempts*
751761
*to swap.*
752762

0 commit comments

Comments
 (0)