5353ENTRY (Reset_Handler)
5454
5555/* Highest address of the user mode stack */
56- _estack = 0x20010000 ; /* end of RAM */
56+ _estack = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM) ; /* end of RAM */
5757/* Generate a link error if heap and stack don't fit into RAM */
5858_Min_Heap_Size = 0x200 ; /* required amount of heap */
5959_Min_Stack_Size = 0x400 ; /* required amount of stack */
6363{
6464DTCMRAM (xrw) : ORIGIN = 0x20000000 , LENGTH = 128K
6565SIGNATURE (rx) : ORIGIN = 0x23FFFFC0 , LENGTH = 64 /* Never written to the RAM, it is for binary signature. */
66- RAM_D1 (xrw) : ORIGIN = 0x24000000 , LENGTH = 512K
66+ RAM_D1 (xrw) : ORIGIN = 0x24000000 , LENGTH = 128K
6767RAM_D2 (xrw) : ORIGIN = 0x30000000 , LENGTH = 288K
6868RAM_D3 (xrw) : ORIGIN = 0x38000000 , LENGTH = 64K
6969ITCMRAM (xrw) : ORIGIN = 0x00000000 , LENGTH = 64K
@@ -78,6 +78,13 @@ SECTIONS
7878 KEEP (*(.bl_ram_signature ))
7979 } >SIGNATURE
8080
81+ .restart_info (NOLOAD) :
82+ {
83+ . = ALIGN (4 );
84+ KEEP (*(.restart_info ))
85+ . = ALIGN (4 );
86+ } >DTCMRAM
87+
8188 /* The startup code goes first into RAM_D1 */
8289 .isr_vector :
8390 {
@@ -113,7 +120,7 @@ SECTIONS
113120 } >RAM_D1
114121
115122 .ARM .extab (READONLY) : /* The READONLY keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
116- {
123+ {
117124 *(.ARM .extab * .gnu .linkonce .armextab .*)
118125 } >RAM_D1
119126
@@ -144,13 +151,8 @@ SECTIONS
144151 KEEP (*(.fini_array *))
145152 PROVIDE_HIDDEN (__fini_array_end = .);
146153 } >RAM_D1
147-
148- .restart_info : ALIGN (4 )
149- {
150- KEEP (*(.restart_info ))
151- } >DTCMRAM AT> RAM_D1
152154
153- /* used by the startup to initialize data */
155+ /* used by the startup to initialize data */
154156 _sidata = LOADADDR (.data );
155157
156158 /* Initialized data sections goes into RAM, load LMA copy after code */
@@ -161,10 +163,10 @@ SECTIONS
161163 *(.data ) /* .data sections */
162164 *(.data *) /* .data* sections */
163165
164- . = ALIGN (4 );
166+ . = ALIGN (8 );
167+ . = . + 4 ; /* Workaround for AXISRAM preserving data after reset */
165168 _edata = .; /* define a global symbol at data end */
166169 } >DTCMRAM AT> RAM_D1
167-
168170
169171 /* Uninitialized data section */
170172 . = ALIGN (4 );
@@ -180,7 +182,7 @@ SECTIONS
180182 . = ALIGN (4 );
181183 _ebss = .; /* define a global symbol at bss end */
182184 __bss_end__ = _ebss;
183- } >DTCMRAM AT> RAM_D1
185+ } >DTCMRAM
184186
185187 /* User_heap_stack section, used to check that there is enough RAM left */
186188 ._user_heap_stack :
@@ -191,7 +193,7 @@ SECTIONS
191193 . = . + _Min_Heap_Size;
192194 . = . + _Min_Stack_Size;
193195 . = ALIGN (8 );
194- } >DTCMRAM AT> RAM_D1
196+ } >DTCMRAM
195197
196198
197199 /* Remove information from the standard libraries */
0 commit comments