Skip to content

Commit 374b705

Browse files
adustmcmonr
authored andcommitted
Call to specific _wrap_sbrk to support 2 region model for heap and stack
1 parent 769a566 commit 374b705

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
@@ -740,12 +740,13 @@ extern "C" uint32_t __HeapLimit;
740740
extern "C" int errno;
741741

742742
// Dynamic memory allocation related syscall.
743-
#if defined(TARGET_NUVOTON)
743+
#if (defined(TARGET_NUVOTON) || defined(TWO_RAM_REGIONS))
744744

745745
// Overwrite _sbrk() to support two region model (heap and stack are two distinct regions).
746746
// __wrap__sbrk() is implemented in:
747747
// TARGET_NUMAKER_PFM_NUC472 targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/TOOLCHAIN_GCC_ARM/nuc472_retarget.c
748748
// TARGET_NUMAKER_PFM_M453 targets/TARGET_NUVOTON/TARGET_M451/TARGET_NUMAKER_PFM_M453/TOOLCHAIN_GCC_ARM/m451_retarget.c
749+
// TARGET_STM32L4 targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4/l4_retarget.c
749750
extern "C" void *__wrap__sbrk(int incr);
750751
extern "C" caddr_t _sbrk(int incr) {
751752
return (caddr_t) __wrap__sbrk(incr);

0 commit comments

Comments
 (0)