diff options
| author | Ian McIntyre <me@mciantyre.dev> | 2026-02-15 07:38:37 -0500 |
|---|---|---|
| committer | Ian McIntyre <me@mciantyre.dev> | 2026-02-15 07:38:37 -0500 |
| commit | 66f3fb862c88ada3fd35e00186376b90fe37154a (patch) | |
| tree | e0270fda15bfbb4f3c68320f9c3bf25bf8503717 /board/build.rs | |
| parent | eb47674359ea27cc5e7824a234067491ff01ab13 (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/build.rs')
| -rw-r--r-- | board/build.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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") |
