Skip to content

Commit e4b0779

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

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
@@ -34,6 +34,7 @@ direct-xip = ["mcuboot-sys/direct-xip"]
3434
downgrade-prevention = ["mcuboot-sys/downgrade-prevention"]
3535
max-align-32 = ["mcuboot-sys/max-align-32"]
3636
hw-rollback-protection = ["mcuboot-sys/hw-rollback-protection"]
37+
logical-sectors-4k= ["mcuboot-sys/logical-sectors-4k"]
3738

3839
[dependencies]
3940
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
@@ -39,6 +39,7 @@ fn main() {
3939
let direct_xip = env::var("CARGO_FEATURE_DIRECT_XIP").is_ok();
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();
42+
let logical_sectors_4k = env::var("CARGO_FEATURE_LOGICAL_SECTORS_4K").is_ok();
4243

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

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

5863
if downgrade_prevention && !overwrite_only {

0 commit comments

Comments
 (0)