From 0bcef077948de8ad1cbe63709d92b324b99acf2c Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 5 Nov 2024 19:47:02 +0100 Subject: [PATCH] bootloader: Set first partition's region as executable. If the first partition has a valid leave region, leave it as executable as it's typically used for the bootloader itself. Signed-off-by: iabdalkader --- src/boot/src/common/mpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/boot/src/common/mpu.c b/src/boot/src/common/mpu.c index 1eb78232b..d827d1995 100644 --- a/src/boot/src/common/mpu.c +++ b/src/boot/src/common/mpu.c @@ -100,7 +100,9 @@ __weak void port_mpu_init(void) { // Configure read-only MPU regions for boot partitions. for (size_t i = 0; i < OMV_BOOT_PARTITIONS_COUNT; i++) { - port_mpu_config(&OMV_BOOT_PARTITIONS[i], 1, 1, 1); + // Note first region is the bootloader's partition, + // which normally needs to be executable. + port_mpu_config(&OMV_BOOT_PARTITIONS[i], 1, 1, (i == 0)); } }