Target_WIZWIKI: Add ARM_LIB_STACK and ARM_LIB_HEAP section

Instead of user defined symbols in assembly files or C files,
use linker scripts to add heap and stack - this is inconsistent
with ARM std linker scripts
pull/9766/head
deepikabhavnani 2019-02-15 15:35:42 -06:00 committed by Deepika
parent 7f6b4e51a3
commit a9ce4b3d9a
5 changed files with 25 additions and 54 deletions

View File

@ -16,6 +16,7 @@
*/
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "mbed_boot.h"
#include "mbed_assert.h"

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 ***
; *************************************************************
@ -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
}
}

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)
; <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
THUMB
@ -204,10 +183,4 @@ EXTI_Handler
ALIGN
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
END

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 ***
; *************************************************************
@ -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
}
}

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)
; <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
THUMB
@ -204,10 +183,4 @@ EXTI_Handler
ALIGN
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
END