1#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m55 -xc 2; command above MUST be in first line (no comment above!) 3 4/* 5;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------- 6*/ 7 8/* memory regions are: 9 secure ROM: 0x10000000 10 non-secure ROM: 0x00000000 11 12 secure RAM: 0x30000000 13 non-secure RAM: 0x20000000 14 */ 15 16/*--------------------- Flash Configuration ---------------------------------- 17; <h> Flash Configuration 18; <o0> Flash Base Address <0x0-0xFFFFFFFF:8> 19; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8> 20; </h> 21 *----------------------------------------------------------------------------*/ 22#define __ROM_BASE 0x00000000 23#define __ROM_SIZE 0x00080000 24 25/*--------------------- Embedded RAM Configuration --------------------------- 26; <h> RAM Configuration 27; <o0> RAM Base Address <0x0-0xFFFFFFFF:8> 28; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8> 29; </h> 30 *----------------------------------------------------------------------------*/ 31#define __RAM_BASE 0x20000000 32#define __RAM_SIZE 0x00040000 33 34/*--------------------- Stack / Heap Configuration --------------------------- 35; <h> Stack / Heap Configuration 36; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> 37; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> 38; </h> 39 *----------------------------------------------------------------------------*/ 40#define __STACK_SIZE 0x00001000 41#define __HEAP_SIZE 0x00000C00 42 43/* 44;------------- <<< end of configuration section >>> --------------------------- 45*/ 46 47 48/*---------------------------------------------------------------------------- 49 User Stack & Heap boundary definition 50 *----------------------------------------------------------------------------*/ 51#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) /* starts at end of RAM */ 52#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */ 53 54 55/*---------------------------------------------------------------------------- 56 Scatter File Definitions definition 57 *----------------------------------------------------------------------------*/ 58#define __RO_BASE __ROM_BASE 59#define __RO_SIZE __ROM_SIZE 60 61#define __RW_BASE __RAM_BASE 62#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE) 63 64 65LR_ROM __RO_BASE __RO_SIZE { ; load region size_region 66 ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address 67 *.o (RESET, +First) 68 *(InRoot$$Sections) 69; *(Veneer$$CMSE) ; uncomment for secure applications 70 .ANY (+RO) 71 .ANY (+XO) 72 } 73 74 RW_RAM __RW_BASE __RW_SIZE { ; RW data 75 .ANY (+RW +ZI) 76 } 77 78#if __HEAP_SIZE > 0 79 ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap 80 } 81#endif 82 83 ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack 84 } 85} 86