Skip to content

Commit 5218c82

Browse files
committed
docs: design: Update maximum image size when using swap-move
When using the swap-move strategy, the area allocated to the trailer no more need to have a size that is a multiple of the sector size, since the area not allocated to the trailer in the first sector holding trailer data can now be used to store firmware data. Signed-off-by: Thomas Altenbach <[email protected]>
1 parent 5b1f9a9 commit 5218c82

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/design.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,23 +296,23 @@ This algorithm is designed so that the higher sector of the primary slot is
296296
used only for allowing sectors to move up. Therefore the most
297297
memory-size-effective slot layout is when the primary slot is larger than
298298
the secondary slot by exactly one sector plus the size of the swap status area,
299-
rounded up to the total size of the sectors it occupies,
300299
although same-sized slots are allowed as well.
301300
The algorithm is limited to support sectors of the same
302301
sector layout. All slot's sectors should be of the same size.
303302

304303
When using this algorithm the maximum image size available for the application
305304
will be:
306305
```
307-
maximum-image-size = (N-1) * slot-sector-size - image-trailer-sectors-size
306+
maximum-image-size = (N-1) * slot-sector-size - image-trailer-size - fallback-trailer-padding
308307
```
309308

310309
Where:
311310
`N` is the number of sectors in the primary slot.
312-
`image-trailer-sectors-size` is the size of the image trailer rounded up to
313-
the total size of sectors its occupied. For instance if the image-trailer-size
314-
is equal to 1056 B and the sector size is equal to 1024 B, then
315-
`image-trailer-sectors-size` will be equal to 2048 B.
311+
`image-trailer-size` is the size of the image trailer.
312+
`fallback-trailer-padding` is the padding required for the fallback trailer and is equal to
313+
`magic-aligned-size - (image-trailer-size mod slot-sector-size)` if that value is strictly greater
314+
than zero, to zero otherwise.
315+
`magic-aligned-size` is the size of the trailer magic field, rounded up to `BOOT_MAX_ALIGN`.
316316

317317
This does imply, if there is any doubt, that the primary slot will be exactly
318318
one sector larger than the secondary slot due to the swap sector alone. It is

0 commit comments

Comments
 (0)