correct linker, add fill pattern for startup

This commit is contained in:
hathach 2022-07-14 12:39:23 +07:00
parent a373b2cece
commit cc29a8c156
No known key found for this signature in database
GPG key ID: F5D50C6D51D17CBA
3 changed files with 17 additions and 1 deletions

View file

@ -244,6 +244,16 @@ Reset_Handler:
.L_loop1_done: .L_loop1_done:
/* Adafruit fill stack region with pattern 0xADADADAD */
ldr r0, =__StackLimit
ldr r1, =__StackSize
ldr r2, =0xADADADAD
.L_fill:
str r2, [r0]
adds r0, 4
subs r1, 4
bne .L_fill
/* This part of work usually is done in C library startup code. Otherwise, /* This part of work usually is done in C library startup code. Otherwise,
* define __STARTUP_CLEAR_BSS to enable it in this startup. This section * define __STARTUP_CLEAR_BSS to enable it in this startup. This section
* clears the RAM where BSS data is located. * clears the RAM where BSS data is located.

View file

@ -14,7 +14,7 @@ MEMORY
* - Concurrent connection peripheral + central + secure links * - Concurrent connection peripheral + central + secure links
* - Event Len, HVN queue, Write CMD queue * - Event Len, HVN queue, Write CMD queue
*/ */
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000 RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20020000 - 0x20006000
} }
SECTIONS SECTIONS

View file

@ -1,11 +1,17 @@
#********************************************** #**********************************************
# Jlink with nrfjprog # Jlink with nrfjprog
#********************************************** #**********************************************
nrfjprog.name=J-Link for Bluefruit nRF52 nrfjprog.name=J-Link for Bluefruit nRF52
nrfjprog.program.tool=bootburn nrfjprog.program.tool=bootburn
nrfjprog.program.cmd={runtime.tools.nrfjprog.path}/nrfjprog nrfjprog.program.cmd={runtime.tools.nrfjprog.path}/nrfjprog
nrfjprog.program.cmd.windows={runtime.tools.nrfjprog.path}/nrfjprog.exe nrfjprog.program.cmd.windows={runtime.tools.nrfjprog.path}/nrfjprog.exe
# Use nrfjprog in PATH
#nrfjprog.program.cmd=nrfjprog
#nrfjprog.program.cmd.windows=nrfjprog.exe
# Burn bootloader pattern # Burn bootloader pattern
nrfjprog.program.burn_pattern="{program.cmd}" --program "{bootloader.file}.hex" -f nrf52 --chiperase --reset nrfjprog.program.burn_pattern="{program.cmd}" --program "{bootloader.file}.hex" -f nrf52 --chiperase --reset