shalan | fd13eb5 | 2020-08-21 16:48:07 +0200 | [diff] [blame] | 1 | MEMORY { |
| 2 | FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0x400000 /* 4MB */ |
Manar | 14d35ac | 2020-10-21 22:47:15 +0200 | [diff] [blame^] | 3 | RAM(xrw) : ORIGIN = 0x00000000, LENGTH = 0x1400 /* 1280 words (5 KB) */ |
shalan | fd13eb5 | 2020-08-21 16:48:07 +0200 | [diff] [blame] | 4 | } |
| 5 | |
| 6 | SECTIONS { |
| 7 | /* The program code and other data goes into FLASH */ |
| 8 | .text : |
| 9 | { |
| 10 | . = ALIGN(4); |
| 11 | *(.text) /* .text sections (code) */ |
| 12 | *(.text*) /* .text* sections (code) */ |
| 13 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ |
| 14 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ |
| 15 | *(.srodata) /* .srodata sections (constants, strings, etc.) */ |
| 16 | *(.srodata*) /* .srodata*sections (constants, strings, etc.) */ |
| 17 | . = ALIGN(4); |
| 18 | _etext = .; /* define a global symbol at end of code */ |
| 19 | _sidata = _etext; /* This is used by the startup to initialize data */ |
| 20 | } >FLASH |
| 21 | |
| 22 | /* Initialized data section */ |
| 23 | .data : AT ( _sidata ) |
| 24 | { |
| 25 | . = ALIGN(4); |
| 26 | _sdata = .; |
| 27 | _ram_start = .; |
| 28 | . = ALIGN(4); |
| 29 | *(.data) |
| 30 | *(.data*) |
| 31 | *(.sdata) |
| 32 | *(.sdata*) |
| 33 | . = ALIGN(4); |
| 34 | _edata = .; |
| 35 | } >RAM |
| 36 | |
| 37 | /* Uninitialized data section */ |
| 38 | .bss : |
| 39 | { |
| 40 | . = ALIGN(4); |
| 41 | _sbss = .; |
| 42 | *(.bss) |
| 43 | *(.bss*) |
| 44 | *(.sbss) |
| 45 | *(.sbss*) |
| 46 | *(COMMON) |
| 47 | |
| 48 | . = ALIGN(4); |
| 49 | _ebss = .; |
| 50 | } >RAM |
| 51 | |
| 52 | /* Define the start of the heap */ |
| 53 | .heap : |
| 54 | { |
| 55 | . = ALIGN(4); |
| 56 | _heap_start = .; |
| 57 | } >RAM |
| 58 | } |