Skip to content

Commit 6c6c2fa

Browse files
authored
Merge pull request #4014 from NXPmicro/Update_GCC_ARM_Linker
Issue 3763: Reduce heap allocation in the GCC linker file
2 parents fdf1ed6 + 8298345 commit 6c6c2fa

File tree

7 files changed

+56
-18
lines changed

7 files changed

+56
-18
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/TOOLCHAIN_GCC_ARM/MK66FN2M0xxx18.ld

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ ENTRY(Reset_Handler)
5050

5151
__ram_vector_table__ = 1;
5252

53-
/* Heap 1/4 of ram and stack 1/8 */
54-
__stack_size__ = 0x8000;
55-
__heap_size__ = 0x10000;
53+
/* With the RTOS in use, this does not affect the main stack size. The size of
54+
* the stack where main runs is determined via the RTOS. */
55+
__stack_size__ = 0x400;
56+
57+
/* This is the guaranteed minimum available heap size for an application. When
58+
* uVisor is enabled, this is also the maximum available heap size. The
59+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
60+
* heap and the page heap in uVisor applications. */
61+
__heap_size__ = 0x6000;
5662

5763
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
5864
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/device/TOOLCHAIN_GCC_ARM/MK82FN256xxx15.ld

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ ENTRY(Reset_Handler)
5252

5353
__ram_vector_table__ = 1;
5454

55-
/* Heap 1/4 of ram and stack 1/8 */
56-
__stack_size__ = 0x8000;
57-
__heap_size__ = 0x10000;
55+
/* With the RTOS in use, this does not affect the main stack size. The size of
56+
* the stack where main runs is determined via the RTOS. */
57+
__stack_size__ = 0x400;
58+
59+
/* This is the guaranteed minimum available heap size for an application. When
60+
* uVisor is enabled, this is also the maximum available heap size. The
61+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
62+
* heap and the page heap in uVisor applications. */
63+
__heap_size__ = 0x6000;
5864

5965
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
6066
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/device/TOOLCHAIN_GCC_ARM/MKL27Z64xxx4.ld

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ ENTRY(Reset_Handler)
5353

5454
__ram_vector_table__ = 1;
5555

56-
/* Heap 1/4 of ram and stack 1/8 */
57-
__stack_size__ = 0x800;
58-
__heap_size__ = 0x1000;
56+
/* With the RTOS in use, this does not affect the main stack size. The size of
57+
* the stack where main runs is determined via the RTOS. */
58+
__stack_size__ = 0x400;
59+
/* With the RTOS in use, this does not affect the main heap size. */
60+
__heap_size__ = 0x0;
5961

6062
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
6163
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/device/TOOLCHAIN_GCC_ARM/MKL43Z256xxx4.ld

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ ENTRY(Reset_Handler)
5050

5151
__ram_vector_table__ = 1;
5252

53-
/* Heap 1/4 of ram and stack 1/8 */
54-
__stack_size__ = 0x1000;
53+
/* With the RTOS in use, this does not affect the main stack size. The size of
54+
* the stack where main runs is determined via the RTOS. */
55+
__stack_size__ = 0x400;
56+
57+
/* This is the guaranteed minimum available heap size for an application. When
58+
* uVisor is enabled, this is also the maximum available heap size. The
59+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
60+
* heap and the page heap in uVisor applications. */
5561
__heap_size__ = 0x2800;
5662

5763
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/device/TOOLCHAIN_GCC_ARM/MKL82Z128xxx7.ld

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ ENTRY(Reset_Handler)
5353

5454
__ram_vector_table__ = 1;
5555

56-
/* Heap 1/4 of ram and stack 1/8 */
57-
__stack_size__ = 0x3000;
56+
/* With the RTOS in use, this does not affect the main stack size. The size of
57+
* the stack where main runs is determined via the RTOS. */
58+
__stack_size__ = 0x400;
59+
60+
/* This is the guaranteed minimum available heap size for an application. When
61+
* uVisor is enabled, this is also the maximum available heap size. The
62+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
63+
* heap and the page heap in uVisor applications. */
5864
__heap_size__ = 0x6000;
5965

6066
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/device/TOOLCHAIN_GCC_ARM/MKW24D512xxx5.ld

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ ENTRY(Reset_Handler)
4848

4949
__ram_vector_table__ = 1;
5050

51-
/* Heap 1/4 of ram and stack 1/8 */
52-
__stack_size__ = 0x2000;
51+
/* With the RTOS in use, this does not affect the main stack size. The size of
52+
* the stack where main runs is determined via the RTOS. */
53+
__stack_size__ = 0x400;
54+
55+
/* This is the guaranteed minimum available heap size for an application. When
56+
* uVisor is enabled, this is also the maximum available heap size. The
57+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
58+
* heap and the page heap in uVisor applications. */
5359
__heap_size__ = 0x4000;
5460

5561
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/device/TOOLCHAIN_GCC_ARM/MKW41Z512xxx4.ld

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ ENTRY(Reset_Handler)
4848

4949
__ram_vector_table__ = 1;
5050

51-
/* Heap 1/4 of ram and stack 1/8 */
52-
__stack_size__ = 0x4000;
53-
__heap_size__ = 0x8000;
51+
/* With the RTOS in use, this does not affect the main stack size. The size of
52+
* the stack where main runs is determined via the RTOS. */
53+
__stack_size__ = 0x400;
54+
55+
/* This is the guaranteed minimum available heap size for an application. When
56+
* uVisor is enabled, this is also the maximum available heap size. The
57+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
58+
* heap and the page heap in uVisor applications. */
59+
__heap_size__ = 0x6000;
5460

5561
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
5662
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

0 commit comments

Comments
 (0)