aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2026-02-15 07:38:37 -0500
committerIan McIntyre <me@mciantyre.dev>2026-02-15 07:38:37 -0500
commit66f3fb862c88ada3fd35e00186376b90fe37154a (patch)
treee0270fda15bfbb4f3c68320f9c3bf25bf8503717 /board
parenteb47674359ea27cc5e7824a234067491ff01ab13 (diff)
Add builder config for boot_header inclusion
To form a secondary image, use in_flash to position it in flash, then override the default setting that disables the boot header. With proper configuration, NXP's boot ROM can load a backup image. This commit reconfigures the 1170EVK board for the experiment.
Diffstat (limited to 'board')
-rw-r--r--board/Cargo.toml1
-rw-r--r--board/build.rs8
2 files changed, 6 insertions, 3 deletions
diff --git a/board/Cargo.toml b/board/Cargo.toml
index bfebd0d..f9ef9aa 100644
--- a/board/Cargo.toml
+++ b/board/Cargo.toml
@@ -30,6 +30,7 @@ panic-rtt-target = { version = "0.1", optional = true, features = ["cortex-m"] }
[features]
nonboot = []
+secondary = []
rtic = []
# Begin board features.
teensy4 = [
diff --git a/board/build.rs b/board/build.rs
index e44a11d..d86d287 100644
--- a/board/build.rs
+++ b/board/build.rs
@@ -10,8 +10,10 @@ fn extract_features() -> HashSet<String> {
/// Creates a runtime for a particular family, adjusting whether the image is expected to be boot
/// based on provided features.
fn create_runtime(family: imxrt_rt::Family, flash_size: usize) -> imxrt_rt::RuntimeBuilder {
- if cfg!(feature = "nonboot") {
- imxrt_rt::RuntimeBuilder::in_flash(family, flash_size, 16 * 1024)
+ if cfg!(feature = "nonboot") | cfg!(feature = "secondary") {
+ let mut bldr = imxrt_rt::RuntimeBuilder::in_flash(family, flash_size, 256 * 1024);
+ bldr.boot_header(cfg!(feature = "secondary"));
+ bldr
} else {
imxrt_rt::RuntimeBuilder::from_flexspi(family, flash_size)
}
@@ -54,7 +56,7 @@ fn main() {
.heap_size_env_override("BOARD_HEAP")
.build()
.unwrap(),
- "imxrt1170evk_cm7" => create_runtime(imxrt_rt::Family::Imxrt1170, 8 * 1024 * 1024)
+ "imxrt1170evk_cm7" => create_runtime(imxrt_rt::Family::Imxrt1170, 256 * 1024)
.rodata(imxrt_rt::Memory::Dtcm)
.stack_size_env_override("BOARD_STACK")
.heap_size_env_override("BOARD_HEAP")