Skip to content

Commit ac5d597

Browse files
authored
Merge pull request tock#4962 from sirchnik/mpu-fix
arm-v8m: fix mpu wrong end address
2 parents 1670a26 + 876957b commit ac5d597

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)