]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/main_ns.c
Use the linker script variables for MPU setup for Keil Simulator Demo
[freertos] / FreeRTOS / Demo / CORTEX_MPU_M33F_Simulator_Keil_GCC / NonSecure / main_ns.c
index edb4bdd14714cfe46b9754cb944c19b97ce6a423..42ac4f49ab77a715b6655bf88b7d0171e5ae532f 100644 (file)
 #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