Skip to content

Commit 8637069

Browse files
authored
Merge pull request #11698 from kjbracey-arm/armstack
Clean up ARM toolchain heap+stack setup in targets
2 parents 58ef53a + fb6aa3e commit 8637069

File tree

260 files changed

+536
-2223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+536
-2223
lines changed

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
;
3636
;******************************************************************************
3737

38-
#include "../memory_zones.h"
39-
40-
__initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
41-
4238
PRESERVE8
4339
THUMB
4440

@@ -48,8 +44,9 @@ __initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4844
EXPORT __Vectors
4945
EXPORT __Vectors_End
5046
EXPORT __Vectors_Size
47+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5148

52-
__Vectors DCD __initial_sp ; Top of Stack
49+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5350
DCD Reset_Handler ; Reset Handler
5451
DCD NMI_Handler ; NMI Handler
5552
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
;
3636
;******************************************************************************
3737

38-
#include "../memory_zones.h"
39-
40-
__initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
41-
4238
PRESERVE8
4339
THUMB
4440

@@ -48,8 +44,9 @@ __initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4844
EXPORT __Vectors
4945
EXPORT __Vectors_End
5046
EXPORT __Vectors_Size
47+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5148

52-
__Vectors DCD __initial_sp ; Top of Stack
49+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5350
DCD Reset_Handler ; Reset Handler
5451
DCD NMI_Handler ; NMI Handler
5552
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
;
3636
;******************************************************************************
3737

38-
#include "../memory_zones.h"
39-
40-
__initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
41-
4238
PRESERVE8
4339
THUMB
4440

@@ -48,8 +44,9 @@ __initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4844
EXPORT __Vectors
4945
EXPORT __Vectors_End
5046
EXPORT __Vectors_Size
47+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5148

52-
__Vectors DCD __initial_sp ; Top of Stack
49+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5350
DCD Reset_Handler ; Reset Handler
5451
DCD NMI_Handler ; NMI Handler
5552
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
;
3636
;******************************************************************************
3737

38-
#include "../memory_zones.h"
39-
40-
__initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
41-
4238
PRESERVE8
4339
THUMB
4440

@@ -48,8 +44,9 @@ __initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4844
EXPORT __Vectors
4945
EXPORT __Vectors_End
5046
EXPORT __Vectors_Size
47+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5148

52-
__Vectors DCD __initial_sp ; Top of Stack
49+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5350
DCD Reset_Handler ; Reset Handler
5451
DCD NMI_Handler ; NMI Handler
5552
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_ARM_STD/startup_CMSDK_CM7.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
;
3636
;******************************************************************************
3737

38-
#include "../memory_zones.h"
39-
40-
__initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
41-
4238
PRESERVE8
4339
THUMB
4440

@@ -48,8 +44,9 @@ __initial_sp EQU ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4844
EXPORT __Vectors
4945
EXPORT __Vectors_End
5046
EXPORT __Vectors_Size
47+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5148

52-
__Vectors DCD __initial_sp ; Top of Stack
49+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5350
DCD Reset_Handler ; Reset Handler
5451
DCD NMI_Handler ; NMI Handler
5552
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
* This file is derivative of CMSIS V5.00 startup_ARMCM3.s
2323
*/
2424

25-
#include "../memory_zones.h"
26-
27-
__initial_sp EQU ZBT_SSRAM23_START + ZBT_SSRAM23_SIZE ; Top of ZBT SSRAM2 and 3, used for data
28-
2925
PRESERVE8
3026
THUMB
3127

@@ -36,8 +32,9 @@ __initial_sp EQU ZBT_SSRAM23_START + ZBT_SSRAM23_SIZE ; Top of ZBT SSRAM2
3632
EXPORT __Vectors
3733
EXPORT __Vectors_End
3834
EXPORT __Vectors_Size
35+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
3936

40-
__Vectors DCD __initial_sp ; Top of Stack
37+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
4138
DCD Reset_Handler ; Reset Handler
4239
DCD NMI_Handler ; NMI Handler
4340
DCD HardFault_Handler ; Hard Fault Handler

targets/TARGET_ARM_SSG/TARGET_IOTSS/TARGET_IOTSS_BEID/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,6 @@
3434
; CMSDK_BEID Device
3535
;
3636
;******************************************************************************
37-
;
38-
;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
39-
;
40-
41-
42-
; <h> Stack Configuration
43-
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
44-
; </h>
45-
46-
Stack_Size EQU 0x00004000
47-
48-
AREA STACK, NOINIT, READWRITE, ALIGN=3
49-
Stack_Mem SPACE Stack_Size
50-
__initial_sp
51-
52-
53-
; <h> Heap Configuration
54-
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
55-
; </h>
56-
57-
Heap_Size EQU 0x00001000
58-
59-
AREA HEAP, NOINIT, READWRITE, ALIGN=3
60-
__heap_base
61-
Heap_Mem SPACE Heap_Size
62-
__heap_limit
6337

6438

6539
PRESERVE8
@@ -72,8 +46,9 @@ __heap_limit
7246
EXPORT __Vectors
7347
EXPORT __Vectors_End
7448
EXPORT __Vectors_Size
49+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
7550

76-
__Vectors DCD __initial_sp ; Top of Stack
51+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
7752
DCD Reset_Handler ; Reset Handler
7853
DCD NMI_Handler ; NMI Handler
7954
DCD HardFault_Handler ; Hard Fault Handler
@@ -329,30 +304,4 @@ MPS2_SPI4_IRQHandler
329304
ALIGN
330305

331306

332-
; User Initial Stack & Heap
333-
334-
IF :DEF:__MICROLIB
335-
336-
EXPORT __initial_sp
337-
EXPORT __heap_base
338-
EXPORT __heap_limit
339-
340-
ELSE
341-
342-
IMPORT __use_two_region_memory
343-
EXPORT __user_initial_stackheap
344-
345-
__user_initial_stackheap PROC
346-
LDR R0, = Heap_Mem
347-
LDR R1, =(Stack_Mem + Stack_Size)
348-
LDR R2, = (Heap_Mem + Heap_Size)
349-
LDR R3, = Stack_Mem
350-
BX LR
351-
ENDP
352-
353-
ALIGN
354-
355-
ENDIF
356-
357-
358307
END

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M0/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,6 @@
3434
; CMSDK_CM0 Device
3535
;
3636
;******************************************************************************
37-
;
38-
;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
39-
;
40-
41-
; <h> Heap Configuration
42-
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
43-
; </h>
44-
45-
Heap_Size EQU 0x00000400
46-
47-
AREA HEAP, NOINIT, READWRITE, ALIGN=3
48-
__heap_base
49-
Heap_Mem SPACE Heap_Size
50-
__heap_limit
51-
52-
; <h> Stack Configuration
53-
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
54-
; </h>
55-
56-
Stack_Size EQU 0x00001000
57-
58-
AREA STACK, NOINIT, READWRITE, ALIGN=3
59-
Stack_Mem SPACE Stack_Size
60-
61-
__initial_sp EQU 0x20400000
6237

6338
PRESERVE8
6439
THUMB
@@ -70,8 +45,9 @@ __initial_sp EQU 0x20400000
7045
EXPORT __Vectors
7146
EXPORT __Vectors_End
7247
EXPORT __Vectors_Size
48+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
7349

74-
__Vectors DCD __initial_sp ; Top of Stack
50+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
7551
DCD Reset_Handler ; Reset Handler
7652
DCD NMI_Handler ; NMI Handler
7753
DCD HardFault_Handler ; Hard Fault Handler
@@ -239,30 +215,4 @@ PORT0_7_Handler
239215
ALIGN
240216

241217

242-
; User Initial Stack & Heap
243-
244-
IF :DEF:__MICROLIB
245-
246-
EXPORT __initial_sp
247-
EXPORT __heap_base
248-
EXPORT __heap_limit
249-
250-
ELSE
251-
252-
IMPORT __use_two_region_memory
253-
EXPORT __user_initial_stackheap
254-
255-
__user_initial_stackheap PROC
256-
LDR R0, = Heap_Mem
257-
LDR R1, =(Stack_Mem + Stack_Size)
258-
LDR R2, = (Heap_Mem + Heap_Size)
259-
LDR R3, = Stack_Mem
260-
BX LR
261-
ENDP
262-
263-
ALIGN
264-
265-
ENDIF
266-
267-
268218
END

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M0P/device/TOOLCHAIN_ARM_STD/startup_MPS2.S

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,6 @@
3434
; CMSDK_CM0P Device
3535
;
3636
;******************************************************************************
37-
;
38-
;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
39-
;
40-
41-
; <h> Heap Configuration
42-
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
43-
; </h>
44-
45-
Heap_Size EQU 0x00000400
46-
47-
AREA HEAP, NOINIT, READWRITE, ALIGN=3
48-
__heap_base
49-
Heap_Mem SPACE Heap_Size
50-
__heap_limit
51-
52-
; <h> Stack Configuration
53-
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
54-
; </h>
55-
56-
Stack_Size EQU 0x00001000
57-
58-
AREA STACK, NOINIT, READWRITE, ALIGN=3
59-
Stack_Mem SPACE Stack_Size
60-
61-
__initial_sp EQU 0x20400000
6237

6338
PRESERVE8
6439
THUMB
@@ -70,8 +45,9 @@ __initial_sp EQU 0x20400000
7045
EXPORT __Vectors
7146
EXPORT __Vectors_End
7247
EXPORT __Vectors_Size
48+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
7349

74-
__Vectors DCD __initial_sp ; Top of Stack
50+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
7551
DCD Reset_Handler ; Reset Handler
7652
DCD NMI_Handler ; NMI Handler
7753
DCD HardFault_Handler ; Hard Fault Handler
@@ -239,30 +215,4 @@ PORT0_7_Handler
239215
ALIGN
240216

241217

242-
; User Initial Stack & Heap
243-
244-
IF :DEF:__MICROLIB
245-
246-
EXPORT __initial_sp
247-
EXPORT __heap_base
248-
EXPORT __heap_limit
249-
250-
ELSE
251-
252-
IMPORT __use_two_region_memory
253-
EXPORT __user_initial_stackheap
254-
255-
__user_initial_stackheap PROC
256-
LDR R0, = Heap_Mem
257-
LDR R1, =(Stack_Mem + Stack_Size)
258-
LDR R2, = (Heap_Mem + Heap_Size)
259-
LDR R3, = Stack_Mem
260-
BX LR
261-
ENDP
262-
263-
ALIGN
264-
265-
ENDIF
266-
267-
268218
END

0 commit comments

Comments
 (0)