diff --git a/hal/common/retarget.cpp b/hal/common/retarget.cpp index 29f5d05f4c..79cb598b6d 100644 --- a/hal/common/retarget.cpp +++ b/hal/common/retarget.cpp @@ -461,9 +461,7 @@ extern "C" void __iar_argc_argv() { // Linker defined symbol used by _sbrk to indicate where heap should start. extern "C" int __end__; -#if defined(TARGET_CORTEX_A) extern "C" uint32_t __HeapLimit; -#endif // Turn off the errno macro and use actual global variable instead. #undef errno @@ -486,11 +484,7 @@ extern "C" caddr_t _sbrk(int incr) { unsigned char* prev_heap = heap; unsigned char* new_heap = heap + incr; -#if defined(TARGET_CORTEX_A) if (new_heap >= (unsigned char*)&__HeapLimit) { /* __HeapLimit is end of heap section */ -#else - if (new_heap >= (unsigned char*)__current_sp()) { -#endif errno = ENOMEM; return (caddr_t)-1; } diff --git a/hal/targets/cmsis/TARGET_Freescale/TARGET_MCU_K64F/TOOLCHAIN_GCC_ARM/startup_MK64F12.S b/hal/targets/cmsis/TARGET_Freescale/TARGET_MCU_K64F/TOOLCHAIN_GCC_ARM/startup_MK64F12.S index 300dc050a4..cb7c8f8e83 100644 --- a/hal/targets/cmsis/TARGET_Freescale/TARGET_MCU_K64F/TOOLCHAIN_GCC_ARM/startup_MK64F12.S +++ b/hal/targets/cmsis/TARGET_Freescale/TARGET_MCU_K64F/TOOLCHAIN_GCC_ARM/startup_MK64F12.S @@ -64,7 +64,7 @@ __StackTop: #ifdef __HEAP_SIZE .equ Heap_Size, __HEAP_SIZE #else - .equ Heap_Size, 0x400 + .equ Heap_Size, 0x20000 #endif .globl __HeapBase .globl __HeapLimit