Skip to content

Commit 876957b

Browse files
committed
arm-v8m: fix mpu wrong end address
The RLAR LIMIT is inclusive
1 parent 7a79a1d commit 876957b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/cortex-m33/src/mpu_v8m.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ impl CortexMRegion {
356356

357357
// Limit Address register
358358
let rlar_value = MPU_RLAR::ENABLE::SET
359-
+ MPU_RLAR::LIMIT.val((logical_end as u32) >> 5)
359+
// RLAR::LIMIT is inclusive so `- 1` here to not have the region 32 bytes further.
360+
+ MPU_RLAR::LIMIT.val(((logical_end - 1) as u32) >> 5)
360361
+ MPU_RLAR::PXN::Disable
361362
+ MPU_RLAR::ATTRINDX.val(0);
362363

0 commit comments

Comments
 (0)