Skip to content

Commit d1b902a

Browse files
committed
Update NRF51 link and startup sequence.
* Update softdevice offset so they match the offset of sd 2.0. * Update RAM initialization sequence. * Import fs_data section in final binary
1 parent 3fe77a5 commit d1b902a

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
MEMORY
44
{
5-
FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000
6-
RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x5800
5+
FLASH (rx) : ORIGIN = 0x0001B000, LENGTH = 0x25000
6+
RAM (rwx) : ORIGIN = 0x20002ef8, LENGTH = 0x5108
77
}
88

99
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
@@ -114,6 +114,15 @@ SECTIONS
114114

115115
} > RAM
116116

117+
__edata = .;
118+
119+
.fs_data :
120+
{
121+
PROVIDE(__start_fs_data = .);
122+
KEEP(*(.fs_data))
123+
PROVIDE(__stop_fs_data = .);
124+
} > RAM
125+
117126
.bss :
118127
{
119128
. = ALIGN(4);

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ __Vectors:
117117

118118
/* Reset Handler */
119119

120-
.equ NRF_POWER_RAMON_ADDRESS, 0x40000524
121-
.equ NRF_POWER_RAMON_RAMxON_ONMODE_Msk, 0x3
120+
.equ NRF_POWER_RAMON_ADDRESS, 0x40000524
121+
.equ NRF_POWER_RAMONB_ADDRESS, 0x40000554
122+
.equ NRF_POWER_RAMONx_RAMxON_ONMODE_Msk, 0x3
122123

123124
.text
124125
.thumb
@@ -129,10 +130,14 @@ __Vectors:
129130
Reset_Handler:
130131
.fnstart
131132

132-
/* Make sure ALL RAM banks are powered on */
133+
MOVS R1, #NRF_POWER_RAMONx_RAMxON_ONMODE_Msk
133134
LDR R0, =NRF_POWER_RAMON_ADDRESS
134135
LDR R2, [R0]
135-
MOVS R1, #NRF_POWER_RAMON_RAMxON_ONMODE_Msk
136+
ORRS R2, R1
137+
STR R2, [R0]
138+
139+
LDR R0, =NRF_POWER_RAMONB_ADDRESS
140+
LDR R2, [R0]
136141
ORRS R2, R1
137142
STR R2, [R0]
138143

hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/TOOLCHAIN_GCC_ARM/NRF52832.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ SECTIONS
8383
KEEP(*(.eh_frame*))
8484
} > FLASH
8585

86-
8786
.ARM.extab :
8887
{
8988
*(.ARM.extab* .gnu.linkonce.armextab.*)

0 commit comments

Comments
 (0)