Skip to content

Commit c9a15d0

Browse files
committed
Merge pull request #1854 from pan-/nrf51_port
RTOS port for NRF51 targets
2 parents 83aec2d + c58198e commit c9a15d0

File tree

16 files changed

+433
-75
lines changed

16 files changed

+433
-75
lines changed

hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,20 @@ SECTIONS
124124
__bss_end__ = .;
125125
} > RAM
126126

127-
.heap (COPY):
127+
.heap (NOLOAD):
128128
{
129129
__end__ = .;
130130
end = __end__;
131+
__HeapBase = .;
131132
*(.heap*)
133+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
132134
__HeapLimit = .;
133135
} > RAM
134136

135137
/* .stack_dummy section doesn't contains any symbols. It is only
136138
* used for linker to calculate size of stack sections, and assign
137139
* values to stack symbols later */
138-
.stack_dummy (COPY):
140+
.stack_dummy (NOLOAD):
139141
{
140142
*(.stack*)
141143
} > RAM

hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NRF51_16K_S110/NRF51822.ld

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,20 @@ SECTIONS
124124
__bss_end__ = .;
125125
} > RAM
126126

127-
.heap (COPY):
127+
.heap (NOLOAD):
128128
{
129129
__end__ = .;
130130
end = __end__;
131+
__HeapBase = .;
131132
*(.heap*)
133+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
132134
__HeapLimit = .;
133135
} > RAM
134136

135137
/* .stack_dummy section doesn't contains any symbols. It is only
136138
* used for linker to calculate size of stack sections, and assign
137139
* values to stack symbols later */
138-
.stack_dummy (COPY):
140+
.stack_dummy (NOLOAD):
139141
{
140142
*(.stack*)
141143
} > RAM

hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NRF51_16K_S130/NRF51822.ld

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,20 @@ SECTIONS
124124
__bss_end__ = .;
125125
} > RAM
126126

127-
.heap (COPY):
127+
.heap (NOLOAD):
128128
{
129129
__end__ = .;
130130
end = __end__;
131+
__HeapBase = .;
131132
*(.heap*)
133+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
132134
__HeapLimit = .;
133135
} > RAM
134136

135137
/* .stack_dummy section doesn't contains any symbols. It is only
136138
* used for linker to calculate size of stack sections, and assign
137139
* values to stack symbols later */
138-
.stack_dummy (COPY):
140+
.stack_dummy (NOLOAD):
139141
{
140142
*(.stack*)
141143
} > RAM

hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/startup_NRF51822.S

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
Copyright (c) 2013, Nordic Semiconductor ASA
33
All rights reserved.
44
@@ -28,8 +28,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2828
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
/*
32-
NOTE: Template files (including this one) are application specific and therefore
31+
/*
32+
NOTE: Template files (including this one) are application specific and therefore
3333
expected to be copied into the application project folder prior to its use!
3434
*/
3535

@@ -43,6 +43,7 @@ expected to be copied into the application project folder prior to its use!
4343
#else
4444
.equ Stack_Size, 2048
4545
#endif
46+
.globl Stack_Size
4647
.globl __StackTop
4748
.globl __StackLimit
4849
__StackLimit:
@@ -53,21 +54,9 @@ __StackTop:
5354

5455
.section .heap
5556
.align 3
56-
#ifdef __HEAP_SIZE
57-
.equ Heap_Size, __HEAP_SIZE
58-
#else
59-
.equ Heap_Size, 2048
60-
#endif
6157
.globl __HeapBase
6258
.globl __HeapLimit
63-
__HeapBase:
64-
.if Heap_Size
65-
.space Heap_Size
66-
.endif
67-
.size __HeapBase, . - __HeapBase
68-
__HeapLimit:
69-
.size __HeapLimit, . - __HeapLimit
70-
59+
7160
.section .Vectors
7261
.align 2
7362
.globl __Vectors
@@ -129,7 +118,7 @@ __Vectors:
129118
/* Reset Handler */
130119

131120
.equ NRF_POWER_RAMON_ADDRESS, 0x40000524
132-
.equ NRF_POWER_RAMON_RAMxON_ONMODE_Msk, 0x3
121+
.equ NRF_POWER_RAMON_RAMxON_ONMODE_Msk, 0x3
133122

134123
.text
135124
.thumb
@@ -148,7 +137,7 @@ Reset_Handler:
148137
STR R2, [R0]
149138

150139
/* Loop to copy data from read only memory to RAM. The ranges
151-
* of copy from/to are specified by following symbols evaluated in
140+
* of copy from/to are specified by following symbols evaluated in
152141
* linker script.
153142
* __etext: End of code section, i.e., begin of data sections to copy from.
154143
* __data_start__/__data_end__: RAM address range that data should be
@@ -167,7 +156,7 @@ Reset_Handler:
167156
str r0, [r2,r3]
168157
bgt .LC1
169158
.LC0:
170-
159+
171160
LDR R0, =SystemInit
172161
BLX R0
173162
LDR R0, =_start
@@ -259,4 +248,3 @@ Default_Handler:
259248

260249

261250
.end
262-

0 commit comments

Comments
 (0)