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