; *** Scatter-Loading Description File generated by uVision ***\r
; *************************************************************\r
\r
-; Privileged Code:\r
-; Start : 0x00200000\r
-; End : 0x00208000 - 1\r
-; Size : 32 Kbytes\r
+; Flash Layout\r
+; [ ARMv8-M MPU requires that each region must start on a 32 byte aligned\r
+; address and the size of a region must be a multiple of 32 bytes. ]\r
;\r
-; Privileged Data:\r
-; Start : 0x20200000\r
-; End : 0x20201000 - 1\r
-; Size : 4 Kbytes\r
-LR_IROM_NS_PRIVILEGED 0x00200000 0x00008000 ; load region size_region\r
+; ---------------------\r
+; | Privileged Code |\r
+; ---------------------\r
+; | System Calls |\r
+; ---------------------\r
+; | Unprivileged Code |\r
+; ---------------------\r
+\r
+LR_CODE 0x00200000 ; load region\r
{\r
- ER_IROM_NS_PRIVILEGED +0 ; load address = execution address\r
+ ER_IROM_NS_PRIVILEGED +0 ALIGN 32\r
{\r
*.o(RESET, +First)\r
*(InRoot$$Sections) ; All sections that must be in a root region\r
*(privileged_functions)\r
}\r
\r
- ER_IRAM_NS_PRIVILEGED 0x20200000 0x00001000\r
+ ER_IROM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0\r
{\r
- *(privileged_data)\r
}\r
-}\r
\r
-; FreeRTOS System Calls:\r
-; Start : 0x00208000\r
-; End : 0x00209000 - 1\r
-; Size : 4 Kbytes\r
-LR_IROM_NS_FREERTOS_SYSTEM_CALLS 0x00208000 0x00001000 ; load region size_region\r
-{\r
- ER_IROM_NS_FREERTOS_SYSTEM_CALLS +0 ; load address = execution address\r
+ ER_IROM_NS_FREERTOS_SYSTEM_CALLS +0 ALIGN 32\r
+ {\r
+ *(freertos_system_calls)\r
+ }\r
+\r
+ ER_IROM_NS_FREERTOS_SYSTEM_CALLS_ALIGN +0 ALIGN 32 EMPTY 0x0\r
+ {\r
+ }\r
+\r
+ ER_IROM_NS_UNPRIVILEGED +0 ALIGN 32\r
+ {\r
+ *(+RO)\r
+ }\r
+\r
+ ER_IROM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0\r
{\r
- *(freertos_system_calls)\r
}\r
}\r
\r
-; Unprivileged Code:\r
-; Start : 0x00209000\r
-; End : 0x00400000 - 1\r
-; Size : 2012 Kbytes\r
+; RAM Layout\r
+; [ ARMv8-M MPU requires that each region must start on a 32 byte aligned\r
+; address and the size of a region must be a multiple of 32 bytes. ]\r
;\r
-; Unprivileged Data:\r
-; Start : 0x20201000\r
-; End : 0x20220000 - 1\r
-; Size : 124 Kbytes\r
-LR_IROM_NS_UNPRIVILEGED 0x00209000 0x001F7000 ; load region size_region\r
+; ---------------------\r
+; | Privileged Data |\r
+; ---------------------\r
+; | Unprivileged Data |\r
+; ---------------------\r
+\r
+LR_DATA 0x20200000 ; load region\r
{\r
- ER_IROM_NS_UNPRIVILEGED +0 ; load address = execution address\r
+ ER_IRAM_NS_PRIVILEGED 0x20200000 ALIGN 32\r
+ {\r
+ *(privileged_data)\r
+ }\r
+\r
+ ER_IRAM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0\r
{\r
- *(+RO)\r
}\r
\r
- ER_IRAM_NS_UNPRIVILEGED 0x20201000 0x0001F000\r
+ ER_IRAM_NS_UNPRIVILEGED +0 ALIGN 32\r
{\r
*(+RW, +ZI)\r
}\r
+\r
+ ER_IRAM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0\r
+ {\r
+ }\r
}\r
#include "tz_demo.h"\r
#include "mpu_demo.h"\r
\r
-/* Externs needed by the MPU setup code. These must match the memory map as\r
- * specified in Scatter-Loading description file (FreeRTOSDemo_ns.sct). */\r
+/* Externs needed by the MPU setup code. These are defined in Scatter-Loading\r
+ * description file (FreeRTOSDemo_ns.sct). */\r
+extern uint32_t Image$$ER_IROM_NS_PRIVILEGED$$Base;\r
+extern uint32_t Image$$ER_IROM_NS_PRIVILEGED_ALIGN$$Limit;\r
+extern uint32_t Image$$ER_IROM_NS_FREERTOS_SYSTEM_CALLS$$Base;\r
+extern uint32_t Image$$ER_IROM_NS_FREERTOS_SYSTEM_CALLS_ALIGN$$Limit;\r
+extern uint32_t Image$$ER_IROM_NS_UNPRIVILEGED$$Base;\r
+extern uint32_t Image$$ER_IROM_NS_UNPRIVILEGED_ALIGN$$Limit;\r
+\r
+extern uint32_t Image$$ER_IRAM_NS_PRIVILEGED$$Base;\r
+extern uint32_t Image$$ER_IRAM_NS_PRIVILEGED_ALIGN$$Limit;\r
+extern uint32_t Image$$ER_IRAM_NS_UNPRIVILEGED$$Base;\r
+extern uint32_t Image$$ER_IRAM_NS_UNPRIVILEGED_ALIGN$$Limit;\r
+\r
/* Privileged flash. */\r
-const uint32_t * __privileged_functions_start__ = ( uint32_t * ) ( 0x00200000 );\r
-const uint32_t * __privileged_functions_end__ = ( uint32_t * ) ( 0x00208000 - 0x1 ); /* Last address in privileged Flash region. */\r
+const uint32_t * __privileged_functions_start__ = ( uint32_t * ) &( Image$$ER_IROM_NS_PRIVILEGED$$Base );\r
+const uint32_t * __privileged_functions_end__ = ( uint32_t * ) ( ( uint32_t ) &( Image$$ER_IROM_NS_PRIVILEGED_ALIGN$$Limit ) - 0x1 ); /* Last address in privileged Flash region. */\r
\r
/* Flash containing system calls. */\r
-const uint32_t * __syscalls_flash_start__ = ( uint32_t * ) ( 0x00208000 );\r
-const uint32_t * __syscalls_flash_end__ = ( uint32_t * ) ( 0x00209000 - 0x1 ); /* Last address in Flash region containing system calls. */\r
-\r
-/* Unprivileged flash. Note that the section containing\r
- * system calls is unprivilged so that unprivleged tasks\r
- * can make system calls. */\r
-const uint32_t * __unprivileged_flash_start__ = ( uint32_t * ) ( 0x00209000 );\r
-const uint32_t * __unprivileged_flash_end__ = ( uint32_t * ) ( 0x00400000 - 0x1 ); /* Last address in un-privileged Flash region. */\r
-\r
-/* 512 bytes (0x200) of RAM starting at 0x30008000 is\r
- * priviledged access only. This contains kernel data. */\r
-const uint32_t * __privileged_sram_start__ = ( uint32_t * ) ( 0x20200000 );\r
-const uint32_t * __privileged_sram_end__ = ( uint32_t * ) ( 0x20201000 - 0x1 ); /* Last address in privileged RAM. */\r
+const uint32_t * __syscalls_flash_start__ = ( uint32_t * ) &( Image$$ER_IROM_NS_FREERTOS_SYSTEM_CALLS$$Base );\r
+const uint32_t * __syscalls_flash_end__ = ( uint32_t * ) ( ( uint32_t ) &( Image$$ER_IROM_NS_FREERTOS_SYSTEM_CALLS_ALIGN$$Limit ) - 0x1 ); /* Last address in Flash region containing system calls. */\r
+\r
+/* Unprivileged flash. Note that the section containing system calls is\r
+ * unprivileged so that unprivileged tasks can make system calls. */\r
+const uint32_t * __unprivileged_flash_start__ = ( uint32_t * ) &( Image$$ER_IROM_NS_UNPRIVILEGED$$Base );\r
+const uint32_t * __unprivileged_flash_end__ = ( uint32_t * ) ( ( uint32_t ) &( Image$$ER_IROM_NS_UNPRIVILEGED_ALIGN$$Limit ) - 0x1 ); /* Last address in un-privileged Flash region. */\r
+\r
+/* RAM with priviledged access only. This contains kernel data. */\r
+const uint32_t * __privileged_sram_start__ = ( uint32_t * ) &( Image$$ER_IRAM_NS_PRIVILEGED$$Base );\r
+const uint32_t * __privileged_sram_end__ = ( uint32_t * ) ( ( uint32_t ) &( Image$$ER_IRAM_NS_PRIVILEGED_ALIGN$$Limit ) - 0x1 ); /* Last address in privileged RAM. */\r
;\r
/* Unprivileged RAM. */\r
-const uint32_t * __unprivileged_sram_start__ = ( uint32_t * ) ( 0x20201000 );\r
-const uint32_t * __unprivileged_sram_end__ = ( uint32_t * ) ( 0x20220000 - 0x1 ); /* Last address in un-privileged RAM. */\r
+const uint32_t * __unprivileged_sram_start__ = ( uint32_t * ) &( Image$$ER_IRAM_NS_UNPRIVILEGED$$Base );\r
+const uint32_t * __unprivileged_sram_end__ = ( uint32_t * ) ( ( uint32_t ) &( Image$$ER_IRAM_NS_UNPRIVILEGED_ALIGN$$Limit ) - 0x1 ); /* Last address in un-privileged RAM. */\r
/*-----------------------------------------------------------*/\r
\r
/**\r