sim: Enable sim building with ram-load
Allow the sim to test configurations with MCUBOOT_RAM_LOAD defined.
This does not define any tests for this mode.
This adds definitions for simulated RAM offsets to the simulator. This
will define the offset (from `IMAGE_RAM_BASE`) to where the simulated
RAM will be located. For now, just give these somewhat reasonable
values so that we are able to at least compile the RAM_LOADING code in
the simulator.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/mcuboot-sys/build.rs b/sim/mcuboot-sys/build.rs
index 6f16f04..e4ceefc 100644
--- a/sim/mcuboot-sys/build.rs
+++ b/sim/mcuboot-sys/build.rs
@@ -30,6 +30,7 @@
let bootstrap = env::var("CARGO_FEATURE_BOOTSTRAP").is_ok();
let multiimage = env::var("CARGO_FEATURE_MULTIIMAGE").is_ok();
let downgrade_prevention = env::var("CARGO_FEATURE_DOWNGRADE_PREVENTION").is_ok();
+ let ram_load = env::var("CARGO_FEATURE_RAM_LOAD").is_ok();
let mut conf = cc::Build::new();
conf.define("__BOOTSIM__", None);
@@ -56,6 +57,13 @@
conf.define("MCUBOOT_DOWNGRADE_PREVENTION", None);
}
+ if ram_load {
+ conf.define("MCUBOOT_RAM_LOAD", None);
+
+ conf.define("IMAGE_EXECUTABLE_RAM_START", "0x10000");
+ conf.define("IMAGE_EXECUTABLE_RAM_SIZE", "0x10000");
+ }
+
// Currently no more than one sig type can be used simultaneously.
if vec![sig_rsa, sig_rsa3072, sig_ecdsa, sig_ed25519].iter()
.fold(0, |sum, &v| sum + v as i32) > 1 {