From 8b0d5278b0de5254a242f8a356f061949a896161 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Wed, 26 Nov 2025 10:17:14 -0500 Subject: Allow smaller vector tables in tests The vector tables exported by imxrt-ral are smaller than the default cortex-m-rt vector table. The tests fail once we enable the rt / device features. With this change, we expect the MCU-dependent vector table sizes. --- board/Cargo.toml | 3 +++ tests/inspect_elf.rs | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/board/Cargo.toml b/board/Cargo.toml index 449b807..bfebd0d 100644 --- a/board/Cargo.toml +++ b/board/Cargo.toml @@ -9,12 +9,15 @@ version = "1.0" [dependencies.imxrt-ral] version = "0.5" +features = ["rt"] [dependencies.imxrt-rt] path = ".." +features = ["device"] [build-dependencies.imxrt-rt] path = ".." +features = ["device"] [target.'cfg(all(target_arch = "arm", target_os = "none"))'.dependencies] teensy4-fcb = { version = "0.3", optional = true } diff --git a/tests/inspect_elf.rs b/tests/inspect_elf.rs index 7f25b2a..50bc09a 100644 --- a/tests/inspect_elf.rs +++ b/tests/inspect_elf.rs @@ -206,6 +206,10 @@ const fn aligned(value: u64, alignment: u64) -> u64 { (value + (alignment - 1)) & !(alignment - 1) } +const IMXRT1010_INTERRUPTS: u64 = 80; +const IMXRT1060_INTERRUPTS: u64 = 158; +const IMXRT1170_INTERRUPTS: u64 = 218; + #[test] #[ignore = "building an example can take time"] fn imxrt1010evk() { @@ -251,7 +255,7 @@ fn imxrt1010evk() { assert_eq!( Section { address: stack.address + stack.size, - size: 16 * 4 + 240 * 4 + size: 16 * 4 + IMXRT1010_INTERRUPTS * 4 }, vector_table, "vector table not at expected VMA behind the stack" @@ -355,7 +359,7 @@ fn imxrt1010evk_ram() { assert_eq!( Section { address: stack.address + stack.size, - size: 16 * 4 + 240 * 4 + size: 16 * 4 + IMXRT1010_INTERRUPTS * 4 }, vector_table, "vector table not at expected VMA behind the stack" @@ -475,7 +479,7 @@ fn baseline_teensy4(binary: &ImxrtBinary, dcd_at_runtime: u32, stack_size: u64, assert_eq!( Section { address: stack.address + stack.size, - size: 16 * 4 + 240 * 4 + size: 16 * 4 + IMXRT1060_INTERRUPTS * 4 }, vector_table, "vector table not at expected VMA behind the stack" @@ -693,7 +697,7 @@ fn imxrt1170evk_cm7() { assert_eq!( Section { address: stack.address + stack.size, - size: 16 * 4 + 240 * 4 + size: 16 * 4 + IMXRT1170_INTERRUPTS * 4 }, vector_table, "vector table not at expected VMA behind the stack" @@ -813,7 +817,7 @@ fn imxrt1170evk_cm7_nonboot() { assert_eq!( Section { address: stack.address + stack.size, - size: 16 * 4 + 240 * 4 + size: 16 * 4 + IMXRT1170_INTERRUPTS * 4 }, vector_table, "vector table not at expected VMA behind the stack" -- cgit v1.2.3