1 #! armclang -E --target=arm-arm-none-eabi -mcpu=<CPU> -xc
2 ; command above MUST be in first line (no comment above!)
4 ;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
5 ; #! armclang -E --target=arm-arm-none-eabi -mcpu=<CPU> -xc -mcmse
9 ;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
12 /*--------------------- Flash Configuration ----------------------------------
13 ; <h> Flash Configuration
14 ; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
15 ; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
17 *----------------------------------------------------------------------------*/
18 #define __ROM_BASE 0x00000000
19 #define __ROM_SIZE 0x00080000
21 /*--------------------- Embedded RAM Configuration ---------------------------
22 ; <h> RAM Configuration
23 ; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
24 ; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
26 *----------------------------------------------------------------------------*/
27 #define __RAM_BASE 0x20000000
28 #define __RAM_SIZE 0x00040000
30 /*--------------------- Stack / Heap Configuration ---------------------------
31 ; <h> Stack / Heap Configuration
32 ; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
33 ; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
35 *----------------------------------------------------------------------------*/
36 #define __STACK_SIZE 0x00000200
37 #define __HEAP_SIZE 0x00000C00
39 /*--------------------- CMSE Veneer Configuration ---------------------------
40 ; <h> CMSE Veneer Configuration
41 ; <o0> CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
43 *----------------------------------------------------------------------------*/
44 #define __CMSEVENEER_SIZE 0x200
47 ;------------- <<< end of configuration section >>> ---------------------------
50 /* ----------------------------------------------------------------------------
51 Stack seal size definition
52 *----------------------------------------------------------------------------*/
53 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
54 #define __STACKSEAL_SIZE ( 8 )
56 #define __STACKSEAL_SIZE ( 0 )
60 /*----------------------------------------------------------------------------
61 User Stack & Heap boundary definition
62 *----------------------------------------------------------------------------*/
63 #define __STACK_TOP (__RAM_BASE + __RAM_SIZE - __STACKSEAL_SIZE) /* starts at end of RAM - 8 byte stack seal */
64 #define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
67 /*----------------------------------------------------------------------------
68 Region base & size definition
69 *----------------------------------------------------------------------------*/
70 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
71 #define __CV_BASE ( __ROM_BASE + __ROM_SIZE - __CMSEVENEER_SIZE )
72 #define __CV_SIZE ( __CMSEVENEER_SIZE )
74 #define __CV_SIZE ( 0 )
77 #define __RO_BASE ( __ROM_BASE )
78 #define __RO_SIZE ( __ROM_SIZE - __CV_SIZE )
80 #define __RW_BASE ( __RAM_BASE )
81 #define __RW_SIZE ( __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE )
84 /*----------------------------------------------------------------------------
85 Scatter Region definition
86 *----------------------------------------------------------------------------*/
87 LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
88 ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
95 RW_RAM __RW_BASE __RW_SIZE { ; RW data
100 ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
104 ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
107 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
108 STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack
113 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
114 LR_CMSE_VENEER __CV_BASE ALIGN 32 __CV_SIZE { ; own load/execution region for CMSE Veneers
115 ER_CMSE_VENEER __CV_BASE __CV_SIZE {