File tree Expand file tree Collapse file tree 5 files changed +30
-27
lines changed
TARGET_AMEBA/TARGET_RTL8195A/device Expand file tree Collapse file tree 5 files changed +30
-27
lines changed Original file line number Diff line number Diff line change
1
+ #! armcc -E
2
+ #include "mbed_config.h"
1
3
; Realtek Semiconductor Corp.
2
4
;
3
5
; RTL8195A ARMCC Scatter File
10
12
; DRAM (rwx) : ORIGIN = 0x30000000, LENGTH = 2M
11
13
; }
12
14
15
+ #if (defined(__stack_size__))
16
+ #define Stack_Size __stack_size__
17
+ #else
18
+ #if (defined(MBED_CONF_RTOS_PRESENT))
19
+ #define Stack_Size 0x0400
20
+ #else
21
+ #define Stack_Size 0x1000
22
+ #endif
23
+ #endif
24
+
13
25
LR_IRAM 0x10007000 (0x70000 - 0x7000) {
14
26
15
27
IMAGE2_TABLE 0x10007000 FIXED {
@@ -43,7 +55,7 @@ LR_IRAM 0x10007000 (0x70000 - 0x7000) {
43
55
*mbed_boot*.o (+ZI)
44
56
}
45
57
46
- ARM_LIB_STACK (0x10070000 - 0x1000 ) EMPTY 0x1000 {
58
+ ARM_LIB_STACK (0x10070000 - Stack_Size ) EMPTY Stack_Size {
47
59
}
48
60
}
49
61
Original file line number Diff line number Diff line change 25
25
SRAM2 (rwx) : ORIGIN = 0x30000000, LENGTH = 2M
26
26
}
27
27
28
- /* Stack sizes : */
29
- StackSize = 0x1000;
30
-
31
28
/* Linker script to place sections and symbol values. Should be used together
32
29
* with other linker script that defines memory regions FLASH and RAM.
33
30
* It references following symbols, which must be defined in code :
@@ -195,7 +192,7 @@ SECTIONS
195
192
__end__ = .;
196
193
end = __end__;
197
194
*(.heap*)
198
- . = ORIGIN (SRAM1) + LENGTH (SRAM1) - StackSize ;
195
+ . = ORIGIN (SRAM1) + LENGTH (SRAM1) - Stack_Size ;
199
196
__HeapLimit = .;
200
197
} > SRAM1
201
198
@@ -215,13 +212,13 @@ SECTIONS
215
212
{
216
213
__StackLimit = .;
217
214
*(.stack)
218
- . += StackSize - (. - __StackLimit) ;
215
+ . += Stack_Size ;
219
216
} > SRAM1
220
217
221
218
/* Set stack top to end of RAM, and stack limit move down by
222
219
* size of stack_dummy section */
223
220
__StackTop = ORIGIN (SRAM1) + LENGTH (SRAM1);
224
- __StackLimit = __StackTop - SIZEOF (.stack_dummy) ;
221
+ __StackLimit = __StackTop - Stack_Size ;
225
222
PROVIDE (__stack = __StackTop);
226
223
227
224
/* Check if data + heap + stack exceeds RAM limit */
Original file line number Diff line number Diff line change 17
17
.syntax unified
18
18
.thumb
19
19
20
+ .section .stack
21
+ .align 3
22
+ #ifdef __STACK_SIZE
23
+ .equ Stack_Size, __STACK_SIZE
24
+ #else
25
+ #if defined(MBED_CONF_RTOS_PRESENT)
26
+ .equ Stack_Size, 0x400
27
+ #else
28
+ .equ Stack_Size, 0x1000
29
+ #endif
30
+ #endif
31
+
32
+ .global Stack_Size
20
33
.global __StackTop
21
34
.global PLAT_Init
22
35
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ define region TCM_region = mem:[from __DTCM_start__ to __DTCM_end__];
29
29
define region RAM_region = mem:[from __SRAM_start__ to __SRAM_end__] |
30
30
mem:[from __DRAM_start__ to __DRAM_end__];
31
31
32
- define block CSTACK with alignment = 8, size = 0x1000 { };
32
+ define block CSTACK with alignment = 8, size = 0x400 { };
33
33
define block HEAP with alignment = 8, size = 0x19000 { };
34
34
35
35
do not initialize { section .noinit };
Original file line number Diff line number Diff line change 21
21
22
22
#include "rtl8195a.h"
23
23
24
- #if defined(__CC_ARM ) || (defined(__ARMCC_VERSION ) && (__ARMCC_VERSION >= 6010050 ))
25
- extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base [];
26
- extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Length [];
27
- #define ISR_STACK_START (unsigned char *)(Image$$ARM_LIB_STACK$$ZI$$Base)
28
- #define ISR_STACK_SIZE (uint32_t)(Image$$ARM_LIB_STACK$$ZI$$Length)
29
- #define INITIAL_SP (uint32_t)(Image$$ARM_LIB_STACK$$ZI$$Base)
30
- #elif defined(__GNUC__ )
31
- extern uint32_t __StackTop [];
32
- extern uint32_t __StackLimit [];
33
- extern uint32_t __HeapLimit [];
34
- #define INITIAL_SP (__StackTop)
35
- #endif
36
-
37
- #if defined(__GNUC__ )
38
- #ifndef ISR_STACK_SIZE
39
- #define ISR_STACK_SIZE (0x1000)
40
- #endif
41
- #endif
42
-
43
24
#endif
44
25
#endif
You can’t perform that action at this time.
0 commit comments