Skip to content

Commit 0efc876

Browse files
committed
Call to specific _wrap_sbrk to support 2 region model for heap and stack
1 parent 636ced8 commit 0efc876

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform/mbed_retarget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,12 +1053,13 @@ extern "C" uint32_t __HeapLimit;
10531053
extern "C" int errno;
10541054

10551055
// Dynamic memory allocation related syscall.
1056-
#if defined(TARGET_NUVOTON)
1056+
#if (defined(TARGET_NUVOTON) || defined(TWO_RAM_REGIONS))
10571057

10581058
// Overwrite _sbrk() to support two region model (heap and stack are two distinct regions).
10591059
// __wrap__sbrk() is implemented in:
10601060
// TARGET_NUMAKER_PFM_NUC472 targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/TOOLCHAIN_GCC_ARM/nuc472_retarget.c
10611061
// TARGET_NUMAKER_PFM_M453 targets/TARGET_NUVOTON/TARGET_M451/TARGET_NUMAKER_PFM_M453/TOOLCHAIN_GCC_ARM/m451_retarget.c
1062+
// TARGET_STM32L4 targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4/l4_retarget.c
10621063
extern "C" void *__wrap__sbrk(int incr);
10631064
extern "C" caddr_t _sbrk(int incr) {
10641065
return (caddr_t) __wrap__sbrk(incr);

0 commit comments

Comments
 (0)