Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: reduce duration #541

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions cortex-m-rt/examples/data_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@ use core::ptr;

use rt::entry;

// This large static array uses most of .rodata
static RODATA: [u8; 48 * 1024] = [1u8; 48 * 1024];

// This large mutable array causes .data to use the rest of FLASH
// Large static arrays uses most of .rodata
static RODATA_0: [u8; 8 * 1024] = [1u8; 8 * 1024];
static RODATA_1: [u8; 8 * 1024] = [1u8; 8 * 1024];
static RODATA_2: [u8; 8 * 1024] = [1u8; 8 * 1024];
static RODATA_3: [u8; 8 * 1024] = [1u8; 8 * 1024];
static RODATA_4: [u8; 8 * 1024] = [1u8; 8 * 1024];
static RODATA_5: [u8; 8 * 1024] = [1u8; 8 * 1024];

// These large mutable arrays causes .data to use the rest of FLASH
// without also overflowing RAM.
static mut DATA: [u8; 16 * 1024] = [1u8; 16 * 1024];
static mut DATA_0: [u8; 8 * 1024] = [1u8; 8 * 1024];
static mut DATA_1: [u8; 8 * 1024] = [1u8; 8 * 1024];

#[entry]
fn main() -> ! {
unsafe {
let _bigdata = ptr::read_volatile(ptr::addr_of!(RODATA));
let _bigdata = ptr::read_volatile(ptr::addr_of!(DATA));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_0));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_1));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_2));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_3));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_4));
let _ = ptr::read_volatile(ptr::addr_of!(RODATA_5));

let _ = ptr::read_volatile(ptr::addr_of!(DATA_0));
let _ = ptr::read_volatile(ptr::addr_of!(DATA_1));
}

loop {}
Expand Down
Loading