limit writeable area to the active data area

the top of memory is reserved for various security structures

the security structures do have some hardware protection

but life is better when we also help programmers avoid triggering
the protections by accident and then just being confused.
This commit is contained in:
bunnie 2025-09-29 18:41:29 +08:00
parent a511e3c591
commit f8e124f6f9
2 changed files with 5 additions and 1 deletions

View file

@ -6,6 +6,10 @@ pub const BOOT1_START: usize = 0x6002_0000;
pub const LOADER_START: usize = 0x6006_0000;
pub const BAREMETAL_START: usize = LOADER_START;
pub const KERNEL_START: usize = 0x6008_0000;
// total storage area available in RRAM. Above this are reserved vectors for security apparatus.
pub const RRAM_STORAGE_LEN: usize = 0x3D_A000;
// loadable apps all "start" at this address for UF2 updates
// however these are remapped into external flash based on a defragmentation table
// and app ID. The app ID also has to get encoded into this offset, likely to be

View file

@ -38,7 +38,7 @@ impl Reram {
array: unsafe {
core::slice::from_raw_parts_mut(
utralib::HW_RERAM_MEM as *mut u32,
utralib::HW_RERAM_MEM_LEN / core::mem::size_of::<u32>(),
bao1x_api::RRAM_STORAGE_LEN / core::mem::size_of::<u32>(),
)
},
}