diff --git a/cortex-m-rt/ci/script.sh b/cortex-m-rt/ci/script.sh index 02ba51f0..60e88d7d 100755 --- a/cortex-m-rt/ci/script.sh +++ b/cortex-m-rt/ci/script.sh @@ -55,8 +55,8 @@ main() { cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker done for ex in "${fail_examples[@]}"; do - ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker - ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker + cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker && exit 1 + cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker && exit 1 done cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" -- $linker cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" --release -- $linker diff --git a/cortex-m-rt/examples/data_overflow.rs b/cortex-m-rt/examples/data_overflow.rs index f18d220e..9bc4fc23 100644 --- a/cortex-m-rt/examples/data_overflow.rs +++ b/cortex-m-rt/examples/data_overflow.rs @@ -9,21 +9,22 @@ extern crate cortex_m_rt as rt; extern crate panic_halt; use core::ptr; - use rt::entry; // This large static array uses most of .rodata -static RODATA: [u8; 48 * 1024] = [1u8; 48 * 1024]; +const RODATA_SIZE: usize = 250 * 1024; +static RODATA: [u8; RODATA_SIZE] = [1u8; RODATA_SIZE]; // This large mutable array causes .data to use the rest of FLASH // without also overflowing RAM. -static mut DATA: [u8; 16 * 1024] = [1u8; 16 * 1024]; +const DATA_SIZE: usize = 8 * 1024; +static mut DATA: [u8; DATA_SIZE] = [1u8; DATA_SIZE]; #[entry] fn main() -> ! { unsafe { - let _bigdata = ptr::read_volatile(ptr::addr_of!(RODATA)); - let _bigdata = ptr::read_volatile(ptr::addr_of!(DATA)); + let _bigdata: u8 = ptr::read_volatile(ptr::addr_of!(RODATA) as *const u8); + let _bigdata: u8 = ptr::read_volatile(ptr::addr_of!(DATA) as *const u8); } loop {}