diff options
| author | Karun Koppula <[email protected]> | 2024-04-02 15:51:50 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-02 15:51:50 -0400 |
| commit | 9344f55ff3107917ce1b765bc4fa57965ec86ca6 (patch) | |
| tree | 4ca4936f84d4ad9ecf85a0129159b6d6d20c53cd /embassy-boot | |
| parent | 2caea89b6ab9859470ccf6c7d7414c01251bbecd (diff) | |
| parent | 990f2717673de5e6de6be6a9fb001bc0c8d34745 (diff) | |
Merge branch 'main' into karun/main_octospi_implementation
Diffstat (limited to 'embassy-boot')
| -rw-r--r-- | embassy-boot/src/boot_loader.rs | 24 | ||||
| -rw-r--r-- | embassy-boot/src/fmt.rs | 3 |
2 files changed, 13 insertions, 14 deletions
diff --git a/embassy-boot/src/boot_loader.rs b/embassy-boot/src/boot_loader.rs index ca1a1b10c..a38558056 100644 --- a/embassy-boot/src/boot_loader.rs +++ b/embassy-boot/src/boot_loader.rs | |||
| @@ -183,29 +183,29 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash> BootLoader<ACTIVE, DFU, S | |||
| 183 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | | 183 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 184 | /// |-----------|------------|--------|--------|--------|--------| | 184 | /// |-----------|------------|--------|--------|--------|--------| |
| 185 | /// | Active | 0 | 1 | 2 | 3 | - | | 185 | /// | Active | 0 | 1 | 2 | 3 | - | |
| 186 | /// | DFU | 0 | 3 | 2 | 1 | X | | 186 | /// | DFU | 0 | 4 | 5 | 6 | X | |
| 187 | /// | 187 | /// |
| 188 | /// The algorithm starts by copying 'backwards', and after the first step, the layout is | 188 | /// The algorithm starts by copying 'backwards', and after the first step, the layout is |
| 189 | /// as follows: | 189 | /// as follows: |
| 190 | /// | 190 | /// |
| 191 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | | 191 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 192 | /// |-----------|------------|--------|--------|--------|--------| | 192 | /// |-----------|------------|--------|--------|--------|--------| |
| 193 | /// | Active | 1 | 1 | 2 | 1 | - | | 193 | /// | Active | 1 | 1 | 2 | 6 | - | |
| 194 | /// | DFU | 1 | 3 | 2 | 1 | 3 | | 194 | /// | DFU | 1 | 4 | 5 | 6 | 3 | |
| 195 | /// | 195 | /// |
| 196 | /// The next iteration performs the same steps | 196 | /// The next iteration performs the same steps |
| 197 | /// | 197 | /// |
| 198 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | | 198 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 199 | /// |-----------|------------|--------|--------|--------|--------| | 199 | /// |-----------|------------|--------|--------|--------|--------| |
| 200 | /// | Active | 2 | 1 | 2 | 1 | - | | 200 | /// | Active | 2 | 1 | 5 | 6 | - | |
| 201 | /// | DFU | 2 | 3 | 2 | 2 | 3 | | 201 | /// | DFU | 2 | 4 | 5 | 2 | 3 | |
| 202 | /// | 202 | /// |
| 203 | /// And again until we're done | 203 | /// And again until we're done |
| 204 | /// | 204 | /// |
| 205 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | | 205 | /// | Partition | Swap Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 206 | /// |-----------|------------|--------|--------|--------|--------| | 206 | /// |-----------|------------|--------|--------|--------|--------| |
| 207 | /// | Active | 3 | 3 | 2 | 1 | - | | 207 | /// | Active | 3 | 4 | 5 | 6 | - | |
| 208 | /// | DFU | 3 | 3 | 1 | 2 | 3 | | 208 | /// | DFU | 3 | 4 | 1 | 2 | 3 | |
| 209 | /// | 209 | /// |
| 210 | /// ## REVERTING | 210 | /// ## REVERTING |
| 211 | /// | 211 | /// |
| @@ -220,19 +220,19 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash> BootLoader<ACTIVE, DFU, S | |||
| 220 | /// | 220 | /// |
| 221 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | | 221 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 222 | /// |-----------|--------------|--------|--------|--------|--------| | 222 | /// |-----------|--------------|--------|--------|--------|--------| |
| 223 | /// | Active | 3 | 1 | 2 | 1 | - | | 223 | /// | Active | 3 | 1 | 5 | 6 | - | |
| 224 | /// | DFU | 3 | 3 | 1 | 2 | 3 | | 224 | /// | DFU | 3 | 4 | 1 | 2 | 3 | |
| 225 | /// | 225 | /// |
| 226 | /// | 226 | /// |
| 227 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | | 227 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 228 | /// |-----------|--------------|--------|--------|--------|--------| | 228 | /// |-----------|--------------|--------|--------|--------|--------| |
| 229 | /// | Active | 3 | 1 | 2 | 1 | - | | 229 | /// | Active | 3 | 1 | 2 | 6 | - | |
| 230 | /// | DFU | 3 | 3 | 2 | 2 | 3 | | 230 | /// | DFU | 3 | 4 | 5 | 2 | 3 | |
| 231 | /// | 231 | /// |
| 232 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | | 232 | /// | Partition | Revert Index | Page 0 | Page 1 | Page 3 | Page 4 | |
| 233 | /// |-----------|--------------|--------|--------|--------|--------| | 233 | /// |-----------|--------------|--------|--------|--------|--------| |
| 234 | /// | Active | 3 | 1 | 2 | 3 | - | | 234 | /// | Active | 3 | 1 | 2 | 3 | - | |
| 235 | /// | DFU | 3 | 3 | 2 | 1 | 3 | | 235 | /// | DFU | 3 | 4 | 5 | 6 | 3 | |
| 236 | /// | 236 | /// |
| 237 | pub fn prepare_boot(&mut self, aligned_buf: &mut [u8]) -> Result<State, BootError> { | 237 | pub fn prepare_boot(&mut self, aligned_buf: &mut [u8]) -> Result<State, BootError> { |
| 238 | // Ensure we have enough progress pages to store copy progress | 238 | // Ensure we have enough progress pages to store copy progress |
diff --git a/embassy-boot/src/fmt.rs b/embassy-boot/src/fmt.rs index 78e583c1c..2ac42c557 100644 --- a/embassy-boot/src/fmt.rs +++ b/embassy-boot/src/fmt.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | #![allow(unused_macros)] | 2 | #![allow(unused)] |
| 3 | 3 | ||
| 4 | use core::fmt::{Debug, Display, LowerHex}; | 4 | use core::fmt::{Debug, Display, LowerHex}; |
| 5 | 5 | ||
| @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> { | |||
| 229 | } | 229 | } |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | #[allow(unused)] | ||
| 233 | pub(crate) struct Bytes<'a>(pub &'a [u8]); | 232 | pub(crate) struct Bytes<'a>(pub &'a [u8]); |
| 234 | 233 | ||
| 235 | impl<'a> Debug for Bytes<'a> { | 234 | impl<'a> Debug for Bytes<'a> { |
