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 <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2024-11-05 19:47:02 +01:00
parent 557d293538
commit 0bcef07794

View File

@ -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));
}
}