From ec3805721ca4d519e49e3ebb03bf7914e3f9d7a6 Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Thu, 20 Oct 2022 12:55:42 +0200 Subject: [PATCH] armv8-m: Fix MPU Region Limit Address config On armv8-m the MPU region limits are inclusive. Thus, we must substract one byte of size from (base + limit). Signed-off-by: Michael Jung --- arch/arm/src/armv8-m/arm_mpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/armv8-m/arm_mpu.c b/arch/arm/src/armv8-m/arm_mpu.c index 50ae4ff63c..327b3a030c 100644 --- a/arch/arm/src/armv8-m/arm_mpu.c +++ b/arch/arm/src/armv8-m/arm_mpu.c @@ -163,7 +163,7 @@ void mpu_configure_region(uintptr_t base, size_t size, * aligns with the size of the selected region." */ - limit = (base + size) & MPU_RLAR_LIMIT_MASK; + limit = (base + size - 1) & MPU_RLAR_LIMIT_MASK; base &= MPU_RBAR_BASE_MASK; /* Select the region */