Skip to content

Commit cfb1079

Browse files
authored
Merge pull request #10616 from ThunderSoft123/master
Fix bug Operator new[] out of memory
2 parents 4567626 + 6aeb048 commit cfb1079

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

targets/TARGET_TT/TARGET_TT_M4G9/device/TOOLCHAIN_GCC_ARM/tmpm4g9f15fg.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#define MBED_APP_SIZE 0x180000
1111
#endif
1212

13+
#if !defined(MBED_BOOT_STACK_SIZE)
14+
#define MBED_BOOT_STACK_SIZE 0x400
15+
#endif
16+
17+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
18+
1319
MEMORY
1420
{
1521
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -185,6 +191,7 @@ SECTIONS
185191
__end__ = .;
186192
end = __end__;
187193
KEEP(*(.heap*))
194+
. = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
188195
__HeapLimit = .;
189196
} > RAM
190197

@@ -199,7 +206,7 @@ SECTIONS
199206
/* Set stack top to end of RAM, and stack limit move down by
200207
* size of stack_dummy section */
201208
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
202-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
209+
__StackLimit = __StackTop - STACK_SIZE;
203210
PROVIDE(__stack = __StackTop);
204211

205212
/* Check if data + heap + stack exceeds RAM limit */

0 commit comments

Comments
 (0)