From 6f5633761528e484e8d0963c7ac59403f7210093 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Mon, 13 Mar 2023 06:50:57 -0400 Subject: Prototype API to build runtime in RAM Just a proof-of-concept. The new inspect_elf test seems to show that we're building the correct image. We need another commit in order to help the program run in FlexRAM. --- board/Cargo.toml | 6 ++++++ board/build.rs | 7 +++++++ board/src/imxrt1010evk.rs | 2 +- board/src/lib.rs | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/Cargo.toml b/board/Cargo.toml index 836230c..449b807 100644 --- a/board/Cargo.toml +++ b/board/Cargo.toml @@ -40,6 +40,12 @@ imxrt1010evk = [ "dep:rtt-target", "dep:panic-rtt-target", ] +imxrt1010evk-ram = [ + "imxrt-ral/imxrt1011", + # No FCB required. + "dep:rtt-target", + "dep:panic-rtt-target", +] imxrt1170evk-cm7 = [ "imxrt-ral/imxrt1176_cm7", "dep:imxrt1170evk-fcb", diff --git a/board/build.rs b/board/build.rs index 4531667..e44a11d 100644 --- a/board/build.rs +++ b/board/build.rs @@ -60,6 +60,13 @@ fn main() { .heap_size_env_override("BOARD_HEAP") .build() .unwrap(), + "imxrt1010evk_ram" => { + imxrt_rt::RuntimeBuilder::from_ram(imxrt_rt::Family::Imxrt1010) + .heap_size(1024) + .build() + .unwrap(); + println!("cargo:rustc-cfg=from_ram"); + } _ => continue, } break; diff --git a/board/src/imxrt1010evk.rs b/board/src/imxrt1010evk.rs index 9a596e9..9bcf120 100644 --- a/board/src/imxrt1010evk.rs +++ b/board/src/imxrt1010evk.rs @@ -2,7 +2,7 @@ use crate::ral; -#[cfg(target_arch = "arm")] +#[cfg(all(target_arch = "arm", not(feature = "imxrt1010evk-ram")))] use imxrt1010evk_fcb as _; #[cfg(target_arch = "arm")] use panic_rtt_target as _; diff --git a/board/src/lib.rs b/board/src/lib.rs index ebc76ad..f4912be 100644 --- a/board/src/lib.rs +++ b/board/src/lib.rs @@ -10,7 +10,7 @@ cfg_if::cfg_if! { mod teensy4; pub use teensy4::*; - } else if #[cfg(feature = "imxrt1010evk")] { + } else if #[cfg(any(feature = "imxrt1010evk", feature = "imxrt1010evk-ram"))] { mod shared { pub mod imxrt10xx; } use shared::imxrt10xx::prepare_pit; -- cgit v1.2.3