summaryrefslogtreecommitdiffstats
path: root/bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c')
-rw-r--r--bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c b/bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c
index cbdf41ba73..a2dd595fb5 100644
--- a/bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c
+++ b/bsps/arm/atsam/contrib/libraries/libboard/source/board_lowlevel.c
@@ -347,6 +347,23 @@ void _SetupMemoryRegion(void)
SCB->SHCSR |= (SCB_SHCSR_MEMFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk
| SCB_SHCSR_USGFAULTENA_Msk);
+#ifdef __rtems__
+ dwRegionBaseAddr =
+ ((uintptr_t)atsam_memory_null_begin) |
+ MPU_REGION_VALID |
+ MPU_NULL_REGION;
+ if (atsam_memory_null_begin != atsam_memory_itcm_end) {
+ dwRegionAttr =
+ MPU_AP_NO_ACCESS |
+ MPU_REGION_EXECUTE_NEVER |
+ MPU_CalMPURegionSize((uintptr_t)atsam_memory_null_size) |
+ MPU_REGION_ENABLE;
+ } else {
+ dwRegionAttr = MPU_REGION_DISABLE;
+ }
+ MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+#endif /* __rtems__ */
+
/* Enable the MPU region */
#ifndef __rtems__
MPU_Enable(MPU_ENABLE | MPU_PRIVDEFENA);