Commit 5e6f5e01 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

sim: Add multi-image config support to sim

Add support for building with multiple images to the simulator.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 2bff647d
Loading
Loading
Loading
Loading
+1
Changes for sim/Cargo.toml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ validate-primary-slot = ["mcuboot-sys/validate-primary-slot"]
enc-rsa = ["mcuboot-sys/enc-rsa"]
enc-kw = ["mcuboot-sys/enc-kw"]
bootstrap = ["mcuboot-sys/bootstrap"]
multiimage = ["mcuboot-sys/multiimage"]

[dependencies]
libc = "0.2.0"
+3
Changes for sim/mcuboot-sys/Cargo.toml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ enc-kw = []
# Allow bootstrapping an empty/invalid primary slot from a valid secondary slot
bootstrap = []

# Support multiple images (currently 2 instead of 1).
multiimage = []

[build-dependencies]
cc = "1.0.25"

+2
Changes for sim/mcuboot-sys/build.rs: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ fn main() {
    let enc_rsa = env::var("CARGO_FEATURE_ENC_RSA").is_ok();
    let enc_kw = env::var("CARGO_FEATURE_ENC_KW").is_ok();
    let bootstrap = env::var("CARGO_FEATURE_BOOTSTRAP").is_ok();
    let multiimage = env::var("CARGO_FEATURE_MULTIIMAGE").is_ok();

    let mut conf = cc::Build::new();
    conf.define("__BOOTSIM__", None);
@@ -24,6 +25,7 @@ fn main() {
    conf.define("MCUBOOT_USE_FLASH_AREA_GET_SECTORS", None);
    conf.define("MCUBOOT_HAVE_ASSERT_H", None);
    conf.define("MCUBOOT_MAX_IMG_SECTORS", Some("128"));
    conf.define("MCUBOOT_IMAGE_NUMBER", Some(if multiimage { "2" } else { "1" }));

    if bootstrap {
        conf.define("MCUBOOT_BOOTSTRAP", None);
+2
Changes for sim/mcuboot-sys/csupport/generated_dts_board.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,5 +12,7 @@
#define DT_FLASH_AREA_IMAGE_0_ID 1
#define DT_FLASH_AREA_IMAGE_1_ID 2
#define DT_FLASH_AREA_IMAGE_SCRATCH_ID 3
#define DT_FLASH_AREA_IMAGE_2_ID 4
#define DT_FLASH_AREA_IMAGE_3_ID 5

#endif /*__GENERATED_DTS_BOARD_H__*/