Add bootloader to CI

This commit is contained in:
Ulf Lilleengen
2022-04-26 18:33:09 +02:00
parent 484e0acc63
commit da61611f8f
34 changed files with 163 additions and 173 deletions

View File

@ -16,6 +16,14 @@ pub struct MemoryRegion {
pub kind: MemoryRegionKind,
pub address: u32,
pub size: u32,
pub settings: Option<FlashSettings>,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
pub struct FlashSettings {
pub erase_size: u32,
pub write_size: u32,
pub erase_value: u8,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]

View File

@ -129,6 +129,40 @@ impl Gen {
)
.unwrap();
let flash = chip.memory.iter().find(|r| r.name == "BANK_1").unwrap();
write!(
&mut extra,
"pub const FLASH_BASE: usize = {};\n",
flash.address,
)
.unwrap();
write!(
&mut extra,
"pub const FLASH_SIZE: usize = {};\n",
flash.size,
)
.unwrap();
if let Some(settings) = &flash.settings {
write!(
&mut extra,
"pub const ERASE_SIZE: usize = {};\n",
settings.erase_size,
)
.unwrap();
write!(
&mut extra,
"pub const WRITE_SIZE: usize = {};\n",
settings.write_size,
)
.unwrap();
write!(
&mut extra,
"pub const ERASE_VALUE: u8 = {};\n",
settings.erase_value,
)
.unwrap();
}
// Cleanups!
transform::sort::Sort {}.run(&mut ir).unwrap();
transform::Sanitize {}.run(&mut ir).unwrap();