aboutsummaryrefslogtreecommitdiff
path: root/embassy-boot/src
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2025-11-19 08:23:55 +0000
committerGitHub <[email protected]>2025-11-19 08:23:55 +0000
commit0ee68ed648ef96f001247409a9bacd2dc5cfbb30 (patch)
tree08af5cd8fc7902bd716dd0fc301804489cefb772 /embassy-boot/src
parenta72ba1e0571e6bef9c93c1d98b67724c685a37cc (diff)
parent579f1b4e0b10671605d63d5ddc67a4d9384e84b9 (diff)
Merge pull request #4915 from schult/boot-docs
Improvements to embassy-boot documentation
Diffstat (limited to 'embassy-boot/src')
-rw-r--r--embassy-boot/src/boot_loader.rs12
-rw-r--r--embassy-boot/src/lib.rs4
2 files changed, 11 insertions, 5 deletions
diff --git a/embassy-boot/src/boot_loader.rs b/embassy-boot/src/boot_loader.rs
index c38940d6e..a3a307051 100644
--- a/embassy-boot/src/boot_loader.rs
+++ b/embassy-boot/src/boot_loader.rs
@@ -135,10 +135,12 @@ pub struct BootLoader<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash> {
135 dfu: DFU, 135 dfu: DFU,
136 /// The state partition has the following format: 136 /// The state partition has the following format:
137 /// All ranges are in multiples of WRITE_SIZE bytes. 137 /// All ranges are in multiples of WRITE_SIZE bytes.
138 /// | Range | Description | 138 /// N = Active partition size divided by WRITE_SIZE.
139 /// | 0..1 | Magic indicating bootloader state. BOOT_MAGIC means boot, SWAP_MAGIC means swap. | 139 /// | Range | Description |
140 /// | 1..2 | Progress validity. ERASE_VALUE means valid, !ERASE_VALUE means invalid. | 140 /// | 0..1 | Magic indicating bootloader state. BOOT_MAGIC means boot, SWAP_MAGIC means swap. |
141 /// | 2..2 + N | Progress index used while swapping or reverting 141 /// | 1..2 | Progress validity. ERASE_VALUE means valid, !ERASE_VALUE means invalid. |
142 /// | 2..(2 + 2N) | Progress index used while swapping |
143 /// | (2 + 2N)..(2 + 4N) | Progress index used while reverting
142 state: STATE, 144 state: STATE,
143} 145}
144 146
@@ -429,7 +431,7 @@ fn assert_partitions<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash>(
429 assert_eq!(dfu.capacity() as u32 % page_size, 0); 431 assert_eq!(dfu.capacity() as u32 % page_size, 0);
430 // DFU partition has to be bigger than ACTIVE partition to handle swap algorithm 432 // DFU partition has to be bigger than ACTIVE partition to handle swap algorithm
431 assert!(dfu.capacity() as u32 - active.capacity() as u32 >= page_size); 433 assert!(dfu.capacity() as u32 - active.capacity() as u32 >= page_size);
432 assert!(2 + 2 * (active.capacity() as u32 / page_size) <= state.capacity() as u32 / STATE::WRITE_SIZE as u32); 434 assert!(2 + 4 * (active.capacity() as u32 / page_size) <= state.capacity() as u32 / STATE::WRITE_SIZE as u32);
433} 435}
434 436
435#[cfg(test)] 437#[cfg(test)]
diff --git a/embassy-boot/src/lib.rs b/embassy-boot/src/lib.rs
index 7dc811f66..3e61d6036 100644
--- a/embassy-boot/src/lib.rs
+++ b/embassy-boot/src/lib.rs
@@ -3,6 +3,10 @@
3#![allow(unsafe_op_in_unsafe_fn)] 3#![allow(unsafe_op_in_unsafe_fn)]
4#![warn(missing_docs)] 4#![warn(missing_docs)]
5#![doc = include_str!("../README.md")] 5#![doc = include_str!("../README.md")]
6
7//! ## Feature flags
8#![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)]
9
6mod fmt; 10mod fmt;
7 11
8mod boot_loader; 12mod boot_loader;