Add firmware updater examples to CI

CI was not building the a.rs application due to the requirement of b.bin
having been built first. Add a feature flag to examples so that CI can
build them including a dummy application.

Update a.rs application examples so that they compile again.
This commit is contained in:
Ulf Lilleengen
2023-06-19 23:30:51 +02:00
parent 76659d9003
commit 161d3ce05c
19 changed files with 88 additions and 36 deletions

View File

@ -29,6 +29,7 @@ debug = [
"embassy-boot-rp/defmt",
"panic-probe"
]
skip-include = []
[profile.release]
debug = true

View File

@ -18,7 +18,11 @@ use panic_probe as _;
#[cfg(feature = "panic-reset")]
use panic_reset as _;
#[cfg(feature = "skip-include")]
static APP_B: &[u8] = &[0, 1, 2, 3];
#[cfg(not(feature = "skip-include"))]
static APP_B: &[u8] = include_bytes!("../../b.bin");
const FLASH_SIZE: usize = 2 * 1024 * 1024;
#[embassy_executor::main]
@ -43,7 +47,7 @@ async fn main(_s: Spawner) {
let mut buf: AlignedBuffer<4096> = AlignedBuffer([0; 4096]);
defmt::info!("preparing update");
let writer = updater
.prepare_update()
.prepare_update(&mut buf.0[..1])
.map_err(|e| defmt::warn!("E: {:?}", defmt::Debug2Format(&e)))
.unwrap();
defmt::info!("writer created, starting write");