Allow using separate page sizes for state and dfu

* Less generics on bootloader. Keep PAGE_SIZE as a common multiple of
DFU and ACTIVE page sizes.
* Document restriction
* Add unit tests for different page sizes
This commit is contained in:
Ulf Lilleengen 2022-04-28 10:38:25 +02:00
parent ba46df6825
commit bd237a1f96
10 changed files with 312 additions and 83 deletions
examples/boot
nrf/src/bin
stm32l0/src/bin
stm32l1/src/bin
stm32l4/src/bin
stm32wl/src/bin

View file

@ -40,7 +40,7 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) {
.unwrap();
offset += chunk.len();
}
updater.mark_update(&mut nvmc).await.unwrap();
updater.update(&mut nvmc).await.unwrap();
led.set_high();
cortex_m::peripheral::SCB::sys_reset();
}

View file

@ -41,7 +41,7 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) {
offset += chunk.len();
}
updater.mark_update(&mut flash).await.unwrap();
updater.update(&mut flash).await.unwrap();
led.set_low();
Timer::after(Duration::from_secs(1)).await;
cortex_m::peripheral::SCB::sys_reset();

View file

@ -41,7 +41,7 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) {
offset += chunk.len();
}
updater.mark_update(&mut flash).await.unwrap();
updater.update(&mut flash).await.unwrap();
led.set_low();
Timer::after(Duration::from_secs(1)).await;
cortex_m::peripheral::SCB::sys_reset();

View file

@ -38,7 +38,7 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) {
.unwrap();
offset += chunk.len();
}
updater.mark_update(&mut flash).await.unwrap();
updater.update(&mut flash).await.unwrap();
led.set_low();
cortex_m::peripheral::SCB::sys_reset();
}

View file

@ -40,7 +40,7 @@ async fn main(_s: embassy::executor::Spawner, p: Peripherals) {
.unwrap();
offset += chunk.len();
}
updater.mark_update(&mut flash).await.unwrap();
updater.update(&mut flash).await.unwrap();
//defmt::info!("Marked as updated");
led.set_low();
cortex_m::peripheral::SCB::sys_reset();