Index: c/src/lib/libbsp/arm/atsam/libraries/libboard/source/board_lowlevel.c
===================================================================
--- c/src/lib/libbsp/arm/atsam/libraries/libboard/source/board_lowlevel.c	(revision bdbf1ffa6e81d75ab3ab7adc11e35b1ee1670c29)
+++ c/src/lib/libbsp/arm/atsam/libraries/libboard/source/board_lowlevel.c	(revision f7f420e11ac4b01714a63a6d979a2c8e28b10d4f)
@@ -93,4 +93,5 @@
 	    END_Addr:-    0x003FFFFFUL
 	****************************************************/
+
 	dwRegionBaseAddr =
 		ITCM_START_ADDRESS |
@@ -98,10 +99,19 @@
 		MPU_DEFAULT_ITCM_REGION;        // 1
 
+#ifdef __rtems__
+	if (ITCM_END_ADDRESS + 1 != ITCM_START_ADDRESS) {
+#endif /* __rtems__ */
 	dwRegionAttr =
 		MPU_AP_PRIVILEGED_READ_WRITE |
 		MPU_CalMPURegionSize(ITCM_END_ADDRESS - ITCM_START_ADDRESS) |
 		MPU_REGION_ENABLE;
-
-	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+#ifdef __rtems__
+	} else {
+		dwRegionAttr = MPU_REGION_DISABLE;
+	}
+#endif /* __rtems__ */
+
+	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+
 
 	/****************************************************
@@ -137,4 +147,7 @@
 		MPU_DEFAULT_DTCM_REGION;         //3
 
+#ifdef __rtems__
+	if (DTCM_END_ADDRESS + 1 != DTCM_START_ADDRESS) {
+#endif /* __rtems__ */
 	dwRegionAttr =
 		MPU_AP_PRIVILEGED_READ_WRITE |
@@ -142,6 +155,12 @@
 		MPU_CalMPURegionSize(DTCM_END_ADDRESS - DTCM_START_ADDRESS) |
 		MPU_REGION_ENABLE;
-
-	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+#ifdef __rtems__
+	} else {
+		dwRegionAttr = MPU_REGION_DISABLE;
+	}
+#endif /* __rtems__ */
+
+	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+
 
 	/****************************************************
@@ -184,4 +203,10 @@
 
 	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+#else /* __rtems__ */
+	/* NOTE: The first SRAM region is increased so it covers the whole SRAM. If
+	 * the SRAM is something odd (like 384k on the SAME70Q21), the next higher
+	 * power of two will be used (in the example: 512k). That removes the need of
+	 * the second SRAM region. There is currently no memory after the SRAM so that
+	 * shouldn't be a problem. */
 #endif /* __rtems__ */
 
@@ -219,4 +244,18 @@
 	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
 
+#ifdef __rtems__
+	dwRegionBaseAddr =
+		SYSTEM_START_ADDRESS |
+		MPU_REGION_VALID |
+		MPU_SYSTEM_REGION;
+
+	dwRegionAttr = MPU_AP_FULL_ACCESS |
+				   MPU_REGION_EXECUTE_NEVER |
+				   SHAREABLE_DEVICE_TYPE |
+				   MPU_CalMPURegionSize(SYSTEM_END_ADDRESS - SYSTEM_START_ADDRESS)
+				   | MPU_REGION_ENABLE;
+
+	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
+#endif /* __rtems__ */
 
 	/****************************************************
@@ -268,4 +307,7 @@
 		MPU_QSPIMEM_REGION;              //8
 
+#ifdef __rtems__
+	if (QSPI_END_ADDRESS + 1 != QSPI_START_ADDRESS) {
+#endif /* __rtems__ */
 	dwRegionAttr =
 		MPU_AP_FULL_ACCESS |
@@ -273,4 +315,9 @@
 		MPU_CalMPURegionSize(QSPI_END_ADDRESS - QSPI_START_ADDRESS) |
 		MPU_REGION_ENABLE;
+#ifdef __rtems__
+	} else {
+		dwRegionAttr = MPU_REGION_DISABLE;
+	}
+#endif /* __rtems__ */
 
 	MPU_SetRegion(dwRegionBaseAddr, dwRegionAttr);
@@ -302,5 +349,9 @@
 
 	/* Enable the MPU region */
+#ifndef __rtems__
 	MPU_Enable(MPU_ENABLE | MPU_PRIVDEFENA);
+#else /* __rtems__ */
+	MPU_Enable(MPU_ENABLE);
+#endif /* __rtems__ */
 
 	memory_sync();
Index: c/src/lib/libbsp/arm/atsam/libraries/libchip/include/mpu.h
===================================================================
--- c/src/lib/libbsp/arm/atsam/libraries/libchip/include/mpu.h	(revision bdbf1ffa6e81d75ab3ab7adc11e35b1ee1670c29)
+++ c/src/lib/libbsp/arm/atsam/libraries/libchip/include/mpu.h	(revision f7f420e11ac4b01714a63a6d979a2c8e28b10d4f)
@@ -55,4 +55,5 @@
 	#define MPU_NOCACHE_SRAM_REGION                 (11)
 #endif
+#define MPU_SYSTEM_REGION                       (12)
 
 #define MPU_REGION_VALID                        (0x10)
@@ -102,8 +103,15 @@
 
 /********* IFLASH memory macros *********************/
+#ifdef __rtems__
+#define ITCM_START_ADDRESS                  ((uintptr_t) atsam_memory_itcm_begin)
+#define ITCM_END_ADDRESS                    ((uintptr_t) atsam_memory_itcm_end - 1)
+#define IFLASH_START_ADDRESS                ((uintptr_t) atsam_memory_intflash_begin)
+#define IFLASH_END_ADDRESS                  ((uintptr_t) atsam_memory_intflash_end - 1)
+#else /* !__rtems__ */
 #define ITCM_START_ADDRESS                  0x00000000UL
 #define ITCM_END_ADDRESS                    0x003FFFFFUL
 #define IFLASH_START_ADDRESS                0x00400000UL
 #define IFLASH_END_ADDRESS                  0x005FFFFFUL
+#endif /* __rtems__ */
 
 
@@ -115,22 +123,34 @@
 
 /**************** DTCM  *******************************/
+#ifdef __rtems__
+#define DTCM_START_ADDRESS                  ((uintptr_t) atsam_memory_dtcm_begin)
+#define DTCM_END_ADDRESS                    ((uintptr_t) atsam_memory_dtcm_end - 1)
+#else /* !__rtems__ */
 #define DTCM_START_ADDRESS                  0x20000000UL
 #define DTCM_END_ADDRESS                    0x203FFFFFUL
+#endif /* __rtems__ */
 
 
 /******* SRAM memory macros ***************************/
 
+#ifdef __rtems__
+#define SRAM_START_ADDRESS                  ((uintptr_t) atsam_memory_intsram_begin)
+#define SRAM_END_ADDRESS                    ((uintptr_t) atsam_memory_intsram_end - 1)
+#else /* !__rtems__ */
 #define SRAM_START_ADDRESS                  0x20400000UL
 #define SRAM_END_ADDRESS                    0x2045FFFFUL
-
+#endif /* __rtems__ */
+
+#ifndef __rtems__
 #if defined MPU_HAS_NOCACHE_REGION
 	#define NOCACHE_SRAM_REGION_SIZE            0x1000
 #endif
+#endif /* __rtems__ */
 
 /* Regions should be a 2^(N+1)  where 4 < N < 31 */
 #ifdef __rtems__
-#define SRAM_FIRST_START_ADDRESS            ((uintptr_t) atsam_memory_sdram_begin)
-#define SRAM_FIRST_END_ADDRESS              ((uintptr_t) atsam_memory_sdram_end - 1)
-#else /* __rtems__ */
+#define SRAM_FIRST_START_ADDRESS            ((uintptr_t) atsam_memory_intsram_begin)
+#define SRAM_FIRST_END_ADDRESS              ((uintptr_t) atsam_memory_intsram_end - 1)
+#else /* !__rtems__ */
 #define SRAM_FIRST_START_ADDRESS            (SRAM_START_ADDRESS)
 #define SRAM_FIRST_END_ADDRESS              (SRAM_FIRST_START_ADDRESS + 0x3FFFF)        // (2^18) 256 KB
@@ -141,5 +161,6 @@
 	#define SRAM_NOCACHE_START_ADDRESS          ((uintptr_t) atsam_memory_nocache_begin)
 	#define SRAM_NOCACHE_END_ADDRESS            ((uintptr_t) atsam_memory_nocache_end - 1)
-#else /* __rtems__ */
+	#define NOCACHE_SRAM_REGION_SIZE            (SRAM_NOCACHE_END_ADDRESS - SRAM_NOCACHE_START_ADDRESS)
+#else /* !__rtems__ */
 	#define SRAM_SECOND_START_ADDRESS           (SRAM_FIRST_END_ADDRESS+1)
 	#define SRAM_SECOND_END_ADDRESS             (SRAM_END_ADDRESS - NOCACHE_SRAM_REGION_SIZE)              // (2^17) 128 - 0x1000 KB
@@ -156,4 +177,8 @@
 #define PERIPHERALS_START_ADDRESS            0x40000000UL
 #define PERIPHERALS_END_ADDRESS              0x5FFFFFFFUL
+#ifdef __rtems__
+#define SYSTEM_START_ADDRESS                 0xE0000000UL
+#define SYSTEM_END_ADDRESS                   0xFFFFFFFFUL
+#endif /* __rtems__ */
 
 /******* Ext EBI memory macros ***************************/
@@ -162,10 +187,20 @@
 
 /******* Ext-SRAM memory macros ***************************/
+#ifdef __rtems__
+#define SDRAM_START_ADDRESS                  ((uintptr_t) atsam_memory_sdram_begin)
+#define SDRAM_END_ADDRESS                    ((uintptr_t) atsam_memory_sdram_end - 1)
+#else /* !__rtems__ */
 #define SDRAM_START_ADDRESS                  0x70000000UL
 #define SDRAM_END_ADDRESS                    0x7FFFFFFFUL
+#endif /* __rtems__ */
 
 /******* QSPI macros ***************************/
+#ifdef __rtems__
+#define QSPI_START_ADDRESS                   ((uintptr_t) atsam_memory_qspiflash_begin)
+#define QSPI_END_ADDRESS                     ((uintptr_t) atsam_memory_qspiflash_end - 1)
+#else /* !__rtems__ */
 #define QSPI_START_ADDRESS                   0x80000000UL
 #define QSPI_END_ADDRESS                     0x9FFFFFFFUL
+#endif /* __rtems__ */
 
 /************** USBHS_RAM region macros ******************/
Index: c/src/lib/libbsp/arm/atsam/startup/linkcmds.memory.in
===================================================================
--- c/src/lib/libbsp/arm/atsam/startup/linkcmds.memory.in	(revision bdbf1ffa6e81d75ab3ab7adc11e35b1ee1670c29)
+++ c/src/lib/libbsp/arm/atsam/startup/linkcmds.memory.in	(revision f7f420e11ac4b01714a63a6d979a2c8e28b10d4f)
@@ -8,4 +8,6 @@
 	QSPIFLASH  : ORIGIN = 0x80000000, LENGTH = @ATSAM_MEMORY_QSPIFLASH_SIZE@
 }
+
+/* Must be used only for MPU definitions */
 
 atsam_memory_itcm_begin = ORIGIN (ITCM);
