From 374b705d969df026a8049cfabbd72d17784c38c3 Mon Sep 17 00:00:00 2001 From: adustm Date: Tue, 20 Feb 2018 10:29:50 +0100 Subject: [PATCH] Call to specific _wrap_sbrk to support 2 region model for heap and stack --- platform/mbed_retarget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index 5072d99ef3..04dda6dd28 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -740,12 +740,13 @@ extern "C" uint32_t __HeapLimit; extern "C" int errno; // Dynamic memory allocation related syscall. -#if defined(TARGET_NUVOTON) +#if (defined(TARGET_NUVOTON) || defined(TWO_RAM_REGIONS)) // Overwrite _sbrk() to support two region model (heap and stack are two distinct regions). // __wrap__sbrk() is implemented in: // TARGET_NUMAKER_PFM_NUC472 targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/TOOLCHAIN_GCC_ARM/nuc472_retarget.c // TARGET_NUMAKER_PFM_M453 targets/TARGET_NUVOTON/TARGET_M451/TARGET_NUMAKER_PFM_M453/TOOLCHAIN_GCC_ARM/m451_retarget.c +// TARGET_STM32L4 targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4/l4_retarget.c extern "C" void *__wrap__sbrk(int incr); extern "C" caddr_t _sbrk(int incr) { return (caddr_t) __wrap__sbrk(incr);