Skip to content

Commit f63dfce

Browse files
author
Roberto Spelta
committed
modification to .ld to improve memory
1 parent e466685 commit f63dfce

File tree

1 file changed

+10
-2
lines changed
  • targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/TARGET_SILICA_SENSOR_NODE/device/TOOLCHAIN_GCC_ARM

1 file changed

+10
-2
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/TARGET_SILICA_SENSOR_NODE/device/TOOLCHAIN_GCC_ARM/STM32L476XX.ld

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#define MBED_APP_SIZE 1024k
77
#endif
88

9+
STACK_SIZE = 0x400;
10+
HEAP_SIZE = 0x7800;
11+
912
/* Linker script to configure memory regions. */
1013
MEMORY
1114
{
@@ -86,6 +89,11 @@ SECTIONS
8689
__etext = .;
8790
_sidata = .;
8891

92+
.mesh_heap (COPY):
93+
{
94+
*(mesh_heap*)
95+
} > SRAM2
96+
8997
.data : AT (__etext)
9098
{
9199
__data_start__ = .;
@@ -138,7 +146,7 @@ SECTIONS
138146
{
139147
__end__ = .;
140148
end = __end__;
141-
*(.heap*)
149+
. += HEAP_SIZE;
142150
__HeapLimit = .;
143151
} > SRAM1
144152

@@ -154,7 +162,7 @@ SECTIONS
154162
* size of stack_dummy section */
155163
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
156164
_estack = __StackTop;
157-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
165+
__StackLimit = __StackTop - STACK_SIZE;
158166
PROVIDE(__stack = __StackTop);
159167

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

0 commit comments

Comments
 (0)