mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-04 04:27:34 +00:00
add image size checking in image generator
flags when the kernel is too big now
This commit is contained in:
parent
6080667deb
commit
c4ef7baabb
1 changed files with 13 additions and 0 deletions
|
|
@ -255,6 +255,19 @@ pub fn sign_image(
|
|||
}
|
||||
|
||||
dest_file.write_all(&protected)?;
|
||||
|
||||
if function_code == FunctionCode::Kernel {
|
||||
let target = bao1x_api::RRAM_STORAGE_LEN - (bao1x_api::KERNEL_START - bao1x_api::BOOT0_START);
|
||||
if dest_file.len() > target {
|
||||
println!(
|
||||
"ERROR: Xous RRAM image is too big to fit: {} bytes too large ({} bytes; {} limit)",
|
||||
dest_file.len() - target,
|
||||
dest_file.len(),
|
||||
target,
|
||||
);
|
||||
return Err(String::from("Image doesn't fit").into());
|
||||
}
|
||||
}
|
||||
Ok(dest_file)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue