Skip to content

Commit cc29a8c

Browse files
committed
correct linker, add fill pattern for startup
1 parent a373b2c commit cc29a8c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

cores/nRF5/linker/gcc_startup_nrf52833.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ Reset_Handler:
244244

245245
.L_loop1_done:
246246

247+
/* Adafruit fill stack region with pattern 0xADADADAD */
248+
ldr r0, =__StackLimit
249+
ldr r1, =__StackSize
250+
ldr r2, =0xADADADAD
251+
.L_fill:
252+
str r2, [r0]
253+
adds r0, 4
254+
subs r1, 4
255+
bne .L_fill
256+
247257
/* This part of work usually is done in C library startup code. Otherwise,
248258
* define __STARTUP_CLEAR_BSS to enable it in this startup. This section
249259
* clears the RAM where BSS data is located.

cores/nRF5/linker/nrf52833_s140_v7.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MEMORY
1414
* - Concurrent connection peripheral + central + secure links
1515
* - Event Len, HVN queue, Write CMD queue
1616
*/
17-
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20020000 - 0x20006000
1818
}
1919

2020
SECTIONS

programmers.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#**********************************************
22
# Jlink with nrfjprog
33
#**********************************************
4+
5+
46
nrfjprog.name=J-Link for Bluefruit nRF52
57
nrfjprog.program.tool=bootburn
68
nrfjprog.program.cmd={runtime.tools.nrfjprog.path}/nrfjprog
79
nrfjprog.program.cmd.windows={runtime.tools.nrfjprog.path}/nrfjprog.exe
810

11+
# Use nrfjprog in PATH
12+
#nrfjprog.program.cmd=nrfjprog
13+
#nrfjprog.program.cmd.windows=nrfjprog.exe
14+
915
# Burn bootloader pattern
1016
nrfjprog.program.burn_pattern="{program.cmd}" --program "{bootloader.file}.hex" -f nrf52 --chiperase --reset
1117

0 commit comments

Comments
 (0)