|
1 |
| -if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; } |
2 |
| -if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; } |
| 1 | +/* -DMBED_ROM_START=0x8000000 -DMBED_ROM_SIZE=0x100000 */ |
3 | 2 |
|
4 | 3 | /* [ROM = 1024kb = 0x100000] */
|
5 |
| -define symbol __intvec_start__ = MBED_APP_START; |
6 |
| -define symbol __region_ROM_start__ = MBED_APP_START; |
7 |
| -define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; |
| 4 | +if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; } |
| 5 | +if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; } |
8 | 6 |
|
9 | 7 | /* [RAM = 96kb + 32kb = 0x20000] */
|
10 |
| -/* Vector table dynamic copy: Total: 98 vectors * 4 = 392 bytes (0x188) to be reserved in RAM */ |
11 |
| -define symbol __NVIC_start__ = 0x10000000; |
12 |
| -define symbol __NVIC_end__ = 0x10000187; |
13 |
| -define symbol __region_SRAM2_start__ = 0x10000188; |
14 |
| -define symbol __region_SRAM2_end__ = 0x10007FFF; |
15 |
| -define symbol __region_CRASH_DATA_RAM_start__ = 0x20000000; |
16 |
| -define symbol __region_CRASH_DATA_RAM_end__ = 0x200000FF; |
17 |
| -define symbol __region_SRAM1_start__ = 0x20000100; |
18 |
| -define symbol __region_SRAM1_end__ = 0x20017FFF; |
| 8 | +if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x10000000; } |
| 9 | +if (!isdefinedsymbol(MBED_RAM_SIZE)) { define symbol MBED_RAM_SIZE = 0x8000; } |
19 | 10 |
|
20 |
| -/* Memory regions */ |
21 |
| -define memory mem with size = 4G; |
22 |
| -define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__]; |
23 |
| -define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__]; |
24 |
| -define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__]; |
25 |
| -define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__]; |
| 11 | +if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; } |
| 12 | +if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x18000; } |
26 | 13 |
|
27 |
| -/* Define Crash Data Symbols */ |
28 |
| -define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__; |
29 |
| -define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__; |
| 14 | +/* Vector table dynamic copy: Total: 98 vectors * 4 = 392 bytes (0x188) to be reserved in RAM */ |
| 15 | +if (!isdefinedsymbol(VECTOR_SIZE)) { |
| 16 | + define symbol VECTOR_SIZE = 0x188; |
| 17 | +} |
30 | 18 |
|
31 | 19 | if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
32 | 20 | define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
33 | 21 | }
|
34 | 22 |
|
| 23 | +if (!isdefinedsymbol(MBED_CRASH_REPORT_RAM_SIZE)) { |
| 24 | + define symbol MBED_CRASH_REPORT_RAM_SIZE = 0x100; |
| 25 | +} |
| 26 | + |
| 27 | +if (!isdefinedsymbol(HEAP_SIZE)) { |
| 28 | + define symbol HEAP_SIZE = 0x12000; |
| 29 | +} |
| 30 | + |
| 31 | +define symbol __intvec_start__ = MBED_APP_START; |
| 32 | +define symbol __ROM_start__ = MBED_APP_START; |
| 33 | +define symbol __ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; |
| 34 | + |
| 35 | +/* SRAM 2 */ |
| 36 | +define symbol __NVIC_start__ = MBED_RAM_START; |
| 37 | +define symbol __NVIC_end__ = MBED_RAM_START + VECTOR_SIZE - 1; |
| 38 | + |
| 39 | +define exported symbol __CRASH_DATA_RAM_START__ = MBED_RAM_START + VECTOR_SIZE; |
| 40 | +define exported symbol __CRASH_DATA_RAM_END__ = MBED_RAM_START + VECTOR_SIZE + MBED_CRASH_REPORT_RAM_SIZE - 1; |
| 41 | + |
| 42 | +define symbol __CSTACK_start__ = MBED_RAM_START + VECTOR_SIZE + MBED_CRASH_REPORT_RAM_SIZE; |
| 43 | +define symbol __CSTACK_end__ = MBED_RAM_START + VECTOR_SIZE + MBED_CRASH_REPORT_RAM_SIZE + MBED_BOOT_STACK_SIZE - 1; |
| 44 | + |
| 45 | +define symbol __SRAM2_start__ = MBED_RAM_START + VECTOR_SIZE + MBED_CRASH_REPORT_RAM_SIZE + MBED_BOOT_STACK_SIZE; |
| 46 | +define symbol __SRAM2_end__ = MBED_RAM_START + MBED_RAM_SIZE - 1; |
| 47 | + |
| 48 | +/* SRAM 1*/ |
| 49 | +define symbol __SRAM1_start__ = MBED_RAM1_START; |
| 50 | +define symbol __SRAM1_end__ = MBED_RAM1_START + MBED_RAM1_SIZE - 1; |
| 51 | + |
35 | 52 | define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
|
36 |
| -define symbol __size_heap__ = 0x17000; |
| 53 | +define symbol __size_heap__ = HEAP_SIZE; |
| 54 | + |
| 55 | +/* Memory regions */ |
| 56 | +define memory mem with size = 4G; |
| 57 | +define region ROM_region = mem:[from __ROM_start__ to __ROM_end__]; |
| 58 | +define region CSTACK_region = mem:[from __CSTACK_start__ to __CSTACK_end__]; |
| 59 | +define region RAM_region = mem:[from __SRAM2_start__ to __SRAM2_end__] |
| 60 | + | mem:[from __SRAM1_start__ to __SRAM1_end__]; |
| 61 | + |
37 | 62 | define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
38 |
| -define block HEAP with alignment = 8, size = __size_heap__ { }; |
| 63 | +define block HEAP with expanding size, minimum size = __size_heap__, alignment = 8 { }; |
| 64 | +define block RW { readwrite }; |
| 65 | +define block ZI { zi }; |
39 | 66 |
|
40 | 67 | initialize by copy with packing = zeros { readwrite };
|
41 |
| -do not initialize { section .noinit }; |
42 |
| - |
43 |
| -place at address mem:__intvec_start__ { readonly section .intvec }; |
| 68 | +do not initialize { section .noinit }; |
44 | 69 |
|
45 |
| -place in ROM_region { readonly }; |
46 |
| -place in SRAM1_region { readwrite, block HEAP }; |
47 |
| -place in SRAM2_region { first block CSTACK, zeroinit }; |
| 70 | +place at address mem:__intvec_start__ { readonly section .intvec }; |
| 71 | +place in ROM_region { readonly }; |
| 72 | +place in CSTACK_region { block CSTACK }; |
| 73 | +place in RAM_region { block RW }; |
| 74 | +place in RAM_region { block ZI }; |
| 75 | +place in RAM_region { block HEAP }; |
0 commit comments