Skip to content

Commit 60ec683

Browse files
committed
Use sram2 for mctp-bench buffer
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
1 parent cc52d70 commit 60ec683

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#[allow(unused)]
1212
use log::{debug, error, info, trace, warn};
1313

14+
use core::mem::MaybeUninit;
15+
1416
use heapless::Vec;
1517
use static_cell::StaticCell;
1618

@@ -454,8 +456,12 @@ async fn bench_task(
454456
) -> ! {
455457
debug!("mctp-bench send running");
456458

457-
static BUF: StaticCell<[u8; BENCH_LEN]> = StaticCell::new();
458-
let buf = BUF.init_with(|| [0u8; BENCH_LEN]);
459+
#[link_section = ".sram2_uninit"]
460+
static mut BUF: MaybeUninit<StaticCell<[u8; BENCH_LEN]>> =
461+
MaybeUninit::uninit();
462+
#[allow(static_mut_refs)]
463+
let buf = unsafe { BUF.write(StaticCell::new()) };
464+
let buf = buf.init_with(|| [0u8; _]);
459465

460466
let mut bench = ccvendor::MctpBench::new(buf).unwrap();
461467

0 commit comments

Comments
 (0)