annotate Small_CPU/CPU2-RTE.ld @ 42:2d99d9290a22

Force reset in case of a hard fault
author Ideenmodellierer
date Sun, 29 Jul 2018 16:46:31 +0200
parents da86a7adc4fa
children 321df89d5710
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /* ---------------------------------------------------------------------------- */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /* Em::Blocks embedded development Support */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 /* ---------------------------------------------------------------------------- */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /* Copyright (c) 2014, EmBlocks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /* */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /* All rights reserved. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /* */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 /* Redistribution and use in source and binary forms, with or without */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /* modification, are permitted provided that the following condition is met: */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 /* */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /* - Redistributions of source code must retain the above copyright notice, */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 /* this list of conditions and the disclaimer below. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /* */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 /* EmBlocks's name may not be used to endorse or promote products derived from */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /* this software without specific prior written permission. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /* */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY EBLOCKS "AS IS" AND ANY EXPRESS OR */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /* DISCLAIMED. IN NO EVENT SHALL EMBLOCKS BE LIABLE FOR ANY DIRECT, INDIRECT, */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 /* ---------------------------------------------------------------------------- */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /*------------------------------------------------------------------------------
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * Linker script for running in internal FLASH on the STM32F401RE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 *----------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 OUTPUT_ARCH(arm)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 SEARCH_DIR(.)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 /* Memory Spaces Definitions */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 MEMORY
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 ROM (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* 80000 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 96K
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 /* Linker script to place sections and symbol values. Should be used together
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 * with other linker script that defines memory regions FLASH and RAM.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 * It references following symbols, which must be defined in code:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 * Reset_Handler : Entry of reset handler
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 * It defines following symbols, which code can use without definition:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 * __exidx_start
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * __exidx_end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 * __etext
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 * __data_start__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 * __preinit_array_start
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * __preinit_array_end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 * __init_array_start
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 * __init_array_end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 * __fini_array_start
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 * __fini_array_end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 * __data_end__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * __bss_start__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 * __bss_end__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 * __end__
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 * end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 * __HeapLimit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 * __StackLimit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 * __StackTop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 * __stack
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 SECTIONS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 {
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
73 .isr_vector 0x08000000 :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
74 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
75 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
76 KEEP( *(.isr_vector) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
77 KEEP(*(.init))
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
78 KEEP(*(.fini))
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
79 } >ROM
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
80
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 /* Place FirmwareData at absolute address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 .firmware_data 0x08005000:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 {
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
84 cpu2_FirmwareData = 0;
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
85 KEEP( *(.firmware_data) )
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 } > ROM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
88 .text 0x08005100 :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
89 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
90 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
91 *(.text) /* .text sections (code) */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 *(.text*)
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
93 *(.eh_frame*)
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
94 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
95
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 } > ROM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
98 /********************** Constant data into ROM memory *********************/
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
99 .rodata :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
100 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
101 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
102 *(.rodata) /* .rodata sections (constants, strings, etc.) */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
103 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
104 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
105 } >ROM
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
106
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 .ARM.extab :
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 *(.ARM.extab* .gnu.linkonce.armextab.*)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 } > ROM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 __exidx_start = .;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 .ARM.exidx :
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 } > ROM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 __exidx_end = .;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
119 .preinit_array :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
120 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
121 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
122 PROVIDE_HIDDEN( __preinit_array_start = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
123 KEEP( *(.preinit_array*) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
124 PROVIDE_HIDDEN( __preinit_array_end = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
125 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
126 } >ROM
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
127
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
128 .init_array :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
129 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
130 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
131 PROVIDE_HIDDEN( __init_array_start = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
132 KEEP( *(SORT(.init_array.*)) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
133 KEEP( *(.init_array*) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
134 PROVIDE_HIDDEN( __init_array_end = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
135 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
136 } >ROM
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
137
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
138 .fini_array :
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
139 {
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
140 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
141 PROVIDE_HIDDEN( __fini_array_start = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
142 KEEP( *(SORT(.fini_array.*)) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
143 KEEP( *(.fini_array*) )
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
144 PROVIDE_HIDDEN( __fini_array_end = . );
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
145 . = ALIGN(4);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
146
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
147 __etext = .; /* define a global symbols at end of code */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
148 } >ROM
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
150 /* Used by the startup to initialize data */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
151 _sidata = LOADADDR(.data);
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
152
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
153 .data :
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 . = ALIGN(4);
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
156 __data_start__ = .;
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
157 _sdata = .; /* create a global symbol at data start */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
158 *(.data) /* .data sections */
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
159 *(.data*)
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
160 *(vtable)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 . = ALIGN(4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 /* All data end */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 __data_end__ = .;
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
164 } >RAM AT>ROM
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
166 .bss :
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 __bss_start__ = .;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 *(.bss*)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 *(COMMON)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 __bss_end__ = .;
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
172 } >RAM
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
174 .heap :
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 __end__ = .;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 end = __end__;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 *(.heap*)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 __HeapLimit = .;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 } > RAM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 /* .stack_dummy section doesn't contains any symbols. It is only
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 * used for linker to calculate size of stack sections, and assign
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 * values to stack symbols later */
40
da86a7adc4fa Aligned structure with CPU1 linker file
Ideenmodellierer
parents: 38
diff changeset
185 .stack_dummy :
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 *(.stack)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 } > RAM
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 /* Set stack top to end of RAM, and stack limit move down by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 * size of stack_dummy section */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 PROVIDE(__stack = __StackTop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 /* Check if data + heap + stack exceeds RAM limit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 }