diff --git a/libs/cramium-hal/src/lib.rs b/libs/cramium-hal/src/lib.rs index 04f142641..02b1af8f6 100644 --- a/libs/cramium-hal/src/lib.rs +++ b/libs/cramium-hal/src/lib.rs @@ -30,3 +30,21 @@ pub mod usb; pub use shared_csr::*; #[cfg(not(feature = "hosted-baosec"))] pub mod mbox; +#[cfg(not(feature = "hosted-baosec"))] +pub mod rram; + +#[inline(always)] +pub fn cache_flush() { + unsafe { + // cache flush + #[rustfmt::skip] + core::arch::asm!( + "fence.i", + ".word 0x500F", + "nop", + "nop", + "nop", + "nop", + ); + } +}