Skip to content

Commit cf04234

Browse files
authored
Merge pull request ARMmbed#102 from linlingao/fix_heap
Fix heap size for gcc_arm
2 parents b01c088 + a9189da commit cf04234

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/TOOLCHAIN_GCC_ARM/gcc_arm.ld

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* Case 2: MBED_APP_START is defined as a value greater than ROM_START, this is most likely a build other than the bootloader. E.g., the MCC build.
3030
* In this build, exclude FLASH_HDR region. This workarounds an issue in managed boodloader MCC build where the jump address and stack pointer point to the cookie area
3131
*/
32+
#undef FLASH_HDR_INCLUDED
3233
#define FLASH_HDR_INCLUDED 0
3334
#define ROM_EXEC_START MBED_APP_START
3435
#if defined(MBED_APP_SIZE)
@@ -51,6 +52,13 @@
5152
#endif
5253
#endif
5354

55+
#if !defined(MBED_BOOT_STACK_SIZE)
56+
#define MBED_BOOT_STACK_SIZE 0x400
57+
#endif
58+
59+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
60+
61+
5462
MEMORY
5563
{
5664
FLASH_HDR (rx) : ORIGIN = FLASH_HDR_START, LENGTH = FLASH_HDR_SIZE
@@ -183,9 +191,11 @@ SECTIONS
183191

184192
.heap (COPY):
185193
{
194+
. = ALIGN(4);
186195
__end__ = .;
187-
PROVIDE(end = .);
196+
end = __end__;
188197
*(.heap*)
198+
. = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
189199
__HeapLimit = .;
190200
} > RAM
191201

@@ -200,7 +210,7 @@ SECTIONS
200210
/* Set stack top to end of RAM, and stack limit move down by
201211
* size of stack_dummy section */
202212
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
203-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
213+
__StackLimit = __StackTop - STACK_SIZE;
204214
PROVIDE(__stack = __StackTop);
205215

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

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/TOOLCHAIN_GCC_ARM/startup_CC3220SF.S

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,6 @@ __StackLimit:
4949
__StackTop:
5050
.size __StackTop, . - __StackTop
5151

52-
/*
53-
// <h> Heap Configuration
54-
// <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
55-
// </h>
56-
*/
57-
58-
.section .heap
59-
.align 3
60-
#ifdef __HEAP_SIZE
61-
.equ Heap_Size, __HEAP_SIZE
62-
#else
63-
.equ Heap_Size, 0xA000
64-
#endif
65-
.globl __HeapBase
66-
.globl __HeapLimit
67-
__HeapBase:
68-
.if Heap_Size
69-
.space Heap_Size
70-
.endif
71-
.size __HeapBase, . - __HeapBase
72-
__HeapLimit:
73-
.size __HeapLimit, . - __HeapLimit
74-
7552
.section .isr_vector
7653
.align 2
7754
.globl __Vectors

targets/targets.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8149,9 +8149,12 @@
81498149
},
81508150
"CC3220SF_LAUNCHXL": {
81518151
"inherits": ["CC3220SF"],
8152-
"components": ["SD"],
8152+
"components": ["SD", "FLASHIAP"],
81538153
"device_has": ["USTICKER", "SERIAL", "SERIAL_FC", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "INTERRUPTIN", "SPI", "ANALOGIN", "FLASH", "TRNG", "RTC"],
8154-
"bootloader_supported": true
8154+
"bootloader_supported": true,
8155+
"overrides": {
8156+
"network-default-interface-type": "WIFI"
8157+
}
81558158
},
81568159
"TMPM4G9": {
81578160
"inherits": ["Target"],

0 commit comments

Comments
 (0)