1# Scatter-Loading description file \<device\>_ac6.sct {#linker_sct_pg}
2
3A scatter file for linking is required when using a \ref startup_c_pg.
4
5The \ref linker_sct_pg contains regions for:
6
7 - Code (read-only data, execute-only data)
8 - RAM (read/write data, zero-initialized data)
9 - Stack
10 - Heap
11 - Stack seal (for Armv8-M/v8.1-M)
12 - CMSE veneer (for Armv8-M/v8.1-M)
13
14Within the scatter file, the user needs to specify a set of macros. The scatter file is passed through the C preprocessor which uses these macros to calculate the start address and the size of the different regions.
15
16```
17/*--------------------- Flash Configuration ----------------------------------
18; <h> Flash Configuration
19;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
20;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
21; </h>
22 *----------------------------------------------------------------------------*/
23#define __ROM_BASE      0x00000000
24#define __ROM_SIZE      0x00080000
25
26/*--------------------- Embedded RAM Configuration ---------------------------
27; <h> RAM Configuration
28;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
29;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
30; </h>
31 *----------------------------------------------------------------------------*/
32#define __RAM_BASE      0x20000000
33#define __RAM_SIZE      0x00040000
34
35/*--------------------- Stack / Heap Configuration ---------------------------
36; <h> Stack / Heap Configuration
37;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
38;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
39; </h>
40 *----------------------------------------------------------------------------*/
41#define __STACK_SIZE    0x00000200
42#define __HEAP_SIZE     0x00000C00
43
44/*--------------------- CMSE Veneer Configuration ---------------------------
45; <h> CMSE Veneer Configuration
46;   <o0>  CMSE Veneer Size (in Bytes) <0x0-0xFFFFFFFF:32>
47; </h>
48 *----------------------------------------------------------------------------*/
49#define __CMSEVENEER_SIZE    0x200
50```
51
52> **Note**
53> - The stack is placed at the end of the available RAM and is growing downwards whereas the Heap is placed after the application data and growing upwards.
54
55## Preprocessor command {#linker_sct_preproc_sec}
56
57The scatter file uses following preprocessor command for Arm Compiler v6
58
59```
60#! armclang -E --target=arm-arm-none-eabi -mcpu=&lt;mcpu&gt; -xc
61```
62