1
1
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
2
2
3
3
;
4
- ; Copyright (c) 2019-2020 SparkFun Electronics
4
+ ; Copyright (c) 2019-2021 SparkFun Electronics
5
5
; SPDX-License-Identifier: MIT
6
6
;
7
7
; Permission is hereby granted, free of charge, to any person obtaining a copy
40
40
#define MBED_RAM0_SIZE 0x100
41
41
#define MBED_RAM1_START (MBED_RAM0_START + MBED_RAM0_SIZE)
42
42
#define MBED_RAM1_SIZE (MBED_RAM_SIZE - (MBED_RAM0_SIZE))
43
+ ; This section does not contain any symbols. It is only used for the linker
44
+ ; to calculate the size of the stack sections and assign values to stack
45
+ ; symbols later
46
+ #define STACK_DUMMY_START (MBED_RAM1_START + MBED_RAM1_SIZE)
47
+ #define STACK_DUMMY_SIZE 0x8
48
+ #define Stack_Start (STACK_DUMMY_START - STACK_DUMMY_SIZE)
43
49
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
50
+ ; The heap dummy section is used to identify the beginning of available dynamic memory.
51
+ #define HEAP_DUMMY_SIZE 0x8
52
+ #define Heap_Start AlignExpr(+0, 16)
53
+ #define Heap_Size (MBED_RAM_SIZE - RAM_FIXED_SIZE + MBED_RAM1_START - AlignExpr(ImageLimit(RW_IRAM1), 16) - HEAP_DUMMY_SIZE)
54
+
44
55
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE+MBED_RAM0_SIZE)
45
56
46
57
@@ -56,8 +67,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
56
67
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE {
57
68
.ANY (+RW +ZI)
58
69
}
59
- ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
70
+ ARM_LIB_HEAP Heap_Start EMPTY Heap_Size { ; Heap region growing up
60
71
}
61
- ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE EMPTY -Stack_Size { ; Stack region growing down
72
+ ARM_LIB_STACK Stack_Start EMPTY -Stack_Size { ; Stack region growing down
62
73
}
63
74
}
0 commit comments