modification to .ld to improve memory

pull/5355/head
Roberto Spelta 2017-09-13 16:12:17 +02:00 committed by adbridge
parent 2f4f0b85ac
commit f44d0fb443
1 changed files with 10 additions and 2 deletions

View File

@ -6,6 +6,9 @@
#define MBED_APP_SIZE 1024k #define MBED_APP_SIZE 1024k
#endif #endif
STACK_SIZE = 0x400;
HEAP_SIZE = 0x7800;
/* Linker script to configure memory regions. */ /* Linker script to configure memory regions. */
MEMORY MEMORY
{ {
@ -86,6 +89,11 @@ SECTIONS
__etext = .; __etext = .;
_sidata = .; _sidata = .;
.mesh_heap (COPY):
{
*(mesh_heap*)
} > SRAM2
.data : AT (__etext) .data : AT (__etext)
{ {
__data_start__ = .; __data_start__ = .;
@ -138,7 +146,7 @@ SECTIONS
{ {
__end__ = .; __end__ = .;
end = __end__; end = __end__;
*(.heap*) . += HEAP_SIZE;
__HeapLimit = .; __HeapLimit = .;
} > SRAM1 } > SRAM1
@ -154,7 +162,7 @@ SECTIONS
* size of stack_dummy section */ * size of stack_dummy section */
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1); __StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
_estack = __StackTop; _estack = __StackTop;
__StackLimit = __StackTop - SIZEOF(.stack_dummy); __StackLimit = __StackTop - STACK_SIZE;
PROVIDE(__stack = __StackTop); PROVIDE(__stack = __StackTop);
/* Check if data + heap + stack exceeds RAM limit */ /* Check if data + heap + stack exceeds RAM limit */