Skip to content

Commit 3b0bc54

Browse files
committed
sim: Test logical sectors
Enable logical sector testing. Signed-off-by: Dominik Ermel <[email protected]>
1 parent fc38481 commit 3b0bc54

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

sim/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ downgrade-prevention = ["mcuboot-sys/downgrade-prevention"]
3535
max-align-32 = ["mcuboot-sys/max-align-32"]
3636
hw-rollback-protection = ["mcuboot-sys/hw-rollback-protection"]
3737
check-load-addr = ["mcuboot-sys/check-load-addr"]
38+
logical-sectors-4k= ["mcuboot-sys/logical-sectors-4k"]
3839

3940
[dependencies]
4041
byteorder = "1.4"

sim/mcuboot-sys/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ downgrade-prevention = []
9393
# Support images with 32-byte maximum write alignment value.
9494
max-align-32 = []
9595

96+
# Use logical sectors
97+
logical-sectors-4k = []
98+
9699
# Enable hardware rollback protection
97100
hw-rollback-protection = []
98101

sim/mcuboot-sys/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fn main() {
4040
let max_align_32 = env::var("CARGO_FEATURE_MAX_ALIGN_32").is_ok();
4141
let hw_rollback_protection = env::var("CARGO_FEATURE_HW_ROLLBACK_PROTECTION").is_ok();
4242
let check_load_addr = env::var("CARGO_FEATURE_CHECK_LOAD_ADDR").is_ok();
43+
let logical_sectors_4k = env::var("CARGO_FEATURE_LOGICAL_SECTORS_4K").is_ok();
4344

4445
let mut conf = CachedBuild::new();
4546
conf.conf.define("__BOOTSIM__", None);
@@ -54,6 +55,10 @@ fn main() {
5455
conf.conf.define("MCUBOOT_BOOT_MAX_ALIGN", Some("8"));
5556
}
5657

58+
if logical_sectors_4k {
59+
conf.conf.define("MCUBOOT_LOGICAL_SECTOR_SIZE", Some("4096"));
60+
}
61+
5762
conf.conf.define("MCUBOOT_IMAGE_NUMBER", Some(if multiimage { "2" } else { "1" }));
5863

5964
if downgrade_prevention && !overwrite_only {

0 commit comments

Comments
 (0)