Skip to content

Commit ad8b27a

Browse files
committed
move heap out of FAST_RAM
1 parent f7fc79e commit ad8b27a

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

src/system/stm32f405/flash_layout.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,18 @@ SECTIONS
174174
} >RAM
175175

176176
/* User_heap_stack section, used to check that there is enough RAM left */
177-
._user_heap_stack :
177+
._user_heap :
178178
{
179179
. = ALIGN(4);
180180
PROVIDE ( end = . );
181181
PROVIDE ( _end = . );
182182
. = . + _Min_Heap_Size;
183+
. = ALIGN(4);
184+
} >RAM
185+
186+
._user_stack :
187+
{
188+
. = ALIGN(4);
183189
. = . + _Min_Stack_Size;
184190
. = ALIGN(4);
185191
} >FAST_RAM

src/system/stm32g473/flash_layout.ld

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENTRY(Reset_Handler)
55
_estack = ORIGIN(FAST_RAM) + LENGTH(FAST_RAM); /* end of 128K RAM */
66

77
/* Generate a link error if heap and stack don't fit into RAM */
8-
_Min_Heap_Size = 0x2000; /* required amount of heap */
8+
_Min_Heap_Size = 0x4000; /* required amount of heap */
99
_Min_Stack_Size = 0x4000; /* required amount of stack */
1010

1111
/* Specify the memory areas */
@@ -141,12 +141,18 @@ SECTIONS
141141
} >RAM
142142

143143
/* User_heap_stack section, used to check that there is enough RAM left */
144-
._user_heap_stack :
144+
._user_heap :
145145
{
146146
. = ALIGN(4);
147147
PROVIDE ( end = . );
148148
PROVIDE ( _end = . );
149149
. = . + _Min_Heap_Size;
150+
. = ALIGN(4);
151+
} >RAM
152+
153+
._user_stack :
154+
{
155+
. = ALIGN(4);
150156
. = . + _Min_Stack_Size;
151157
. = ALIGN(4);
152158
} >FAST_RAM

src/system/stm32h743/flash_layout.ld

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ENTRY(Reset_Handler)
1212

1313
/* Highest address of the user mode stack */
14-
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
14+
_estack = ORIGIN(FAST_RAM) + LENGTH(FAST_RAM); /* end of "RAM" Ram type memory */
1515

1616
_Min_Heap_Size = 0x4000; /* required amount of heap */
1717
_Min_Stack_Size = 0x4000; /* required amount of stack */
@@ -173,16 +173,22 @@ SECTIONS
173173
} >RAM
174174

175175
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
176-
._user_heap_stack :
176+
._user_heap :
177177
{
178178
. = ALIGN(8);
179179
PROVIDE ( end = . );
180180
PROVIDE ( _end = . );
181181
. = . + _Min_Heap_Size;
182-
. = . + _Min_Stack_Size;
183182
. = ALIGN(8);
184183
} >RAM
185184

185+
._user_stack :
186+
{
187+
. = ALIGN(8);
188+
. = . + _Min_Stack_Size;
189+
. = ALIGN(8);
190+
} >FAST_RAM
191+
186192
/* Remove information from the compiler libraries */
187193
/DISCARD/ :
188194
{

0 commit comments

Comments
 (0)