Microlib only supports the two region memory model

Update arm_std.c and linker scripts to use ARM_LIB_STACK
and ARM_LIB_HEAP section from scatter files, instead of user
defined symbols
pull/9766/head
deepikabhavnani 2019-02-15 15:19:37 -06:00 committed by Deepika
parent 13945c6db3
commit 7f6b4e51a3
3 changed files with 20 additions and 39 deletions

View File

@ -20,14 +20,11 @@
#include "mbed_boot.h" #include "mbed_boot.h"
#include "mbed_assert.h" #include "mbed_assert.h"
/* Symbols that are typically defined in startup_<mcu>.S */ extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base[];
extern uint32_t __initial_sp[]; extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Length[];
extern uint32_t __heap_base[];
extern uint32_t __heap_limit[];
#if !defined(ISR_STACK_SIZE) extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Base[];
#define ISR_STACK_SIZE ((uint32_t)1024) extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Length[];
#endif
/* /*
* mbed entry point for the MICROLIB toolchain * mbed entry point for the MICROLIB toolchain
@ -41,12 +38,11 @@ void _main_init(void) __attribute__((section(".ARM.Collect$$$$000000FF")));
void _main_init(void) void _main_init(void)
{ {
/* microlib only supports the two region memory model */ /* 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_start = (unsigned char *) Image$$ARM_LIB_HEAP$$ZI$$Base;
mbed_heap_size = (uint32_t)__heap_base - (uint32_t)__heap_limit; mbed_heap_size = (uint32_t) Image$$ARM_LIB_HEAP$$ZI$$Length;
mbed_stack_isr_start = (unsigned char *)((uint32_t)__initial_sp - ISR_STACK_SIZE);
mbed_stack_isr_size = ISR_STACK_SIZE;
mbed_init(); mbed_init();
mbed_rtos_start(); mbed_rtos_start();

View File

@ -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 *** ; *** 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 RW_IRAM1 0x20000000 0x00004000 { ; RW data
.ANY (+RW +ZI) .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
}
} }

View File

@ -27,29 +27,8 @@
;*/ ;*/
; <h> Stack Configuration
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
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) __initial_sp EQU 0x20004000 ; Top of RAM (16 KB for WIZwiki_W7500)
; <h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0x00000400
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8 PRESERVE8
THUMB THUMB
@ -204,10 +183,4 @@ EXTI_Handler
ALIGN ALIGN
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
END END