diff --git a/rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c b/rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c index 06373232de..87a26477c7 100644 --- a/rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c +++ b/rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c @@ -20,14 +20,11 @@ #include "mbed_boot.h" #include "mbed_assert.h" -/* Symbols that are typically defined in startup_.S */ -extern uint32_t __initial_sp[]; -extern uint32_t __heap_base[]; -extern uint32_t __heap_limit[]; +extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base[]; +extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Length[]; -#if !defined(ISR_STACK_SIZE) -#define ISR_STACK_SIZE ((uint32_t)1024) -#endif +extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Base[]; +extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Length[]; /* * mbed entry point for the MICROLIB toolchain @@ -41,12 +38,11 @@ void _main_init(void) __attribute__((section(".ARM.Collect$$$$000000FF"))); void _main_init(void) { /* microlib only supports the two region memory model */ + mbed_stack_isr_start = (unsigned char *) Image$$ARM_LIB_STACK$$ZI$$Base; + mbed_stack_isr_size = (uint32_t) Image$$ARM_LIB_STACK$$ZI$$Length; - mbed_heap_start = (unsigned char *)__heap_base; - mbed_heap_size = (uint32_t)__heap_base - (uint32_t)__heap_limit; - - mbed_stack_isr_start = (unsigned char *)((uint32_t)__initial_sp - ISR_STACK_SIZE); - mbed_stack_isr_size = ISR_STACK_SIZE; + mbed_heap_start = (unsigned char *) Image$$ARM_LIB_HEAP$$ZI$$Base; + mbed_heap_size = (uint32_t) Image$$ARM_LIB_HEAP$$ZI$$Length; mbed_init(); mbed_rtos_start(); diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/W7500.sct b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/W7500.sct index f9ead04667..19589ce626 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/W7500.sct +++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/W7500.sct @@ -1,3 +1,11 @@ +#! armcc -E + +#if !defined(MBED_BOOT_STACK_SIZE) + #define MBED_BOOT_STACK_SIZE 0x400 +#endif + +#define Stack_Size MBED_BOOT_STACK_SIZE + ; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* @@ -11,5 +19,9 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region RW_IRAM1 0x20000000 0x00004000 { ; RW data .ANY (+RW +ZI) } + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x20000000 + 0x00004000 - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { + } + ARM_LIB_STACK (0x20000000+0x00004000) EMPTY -Stack_Size { ; stack + } } diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/startup_W7500x.S b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/startup_W7500x.S index 124a5e65c8..5b161ed02e 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/startup_W7500x.S +++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_MICRO/startup_W7500x.S @@ -27,29 +27,8 @@ ;*/ -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Stack_Size EQU 0x00000400 - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size __initial_sp EQU 0x20004000 ; Top of RAM (16 KB for WIZwiki_W7500) - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Heap_Size EQU 0x00000400 - - AREA HEAP, NOINIT, READWRITE, ALIGN=3 -__heap_base -Heap_Mem SPACE Heap_Size -__heap_limit - - PRESERVE8 THUMB @@ -204,10 +183,4 @@ EXTI_Handler ALIGN - - - EXPORT __initial_sp - EXPORT __heap_base - EXPORT __heap_limit - END