Skip to content

Commit f002c78

Browse files
committed
nrf: linker: add a new .uninitialized section
This section immediately follows the .bss section, and is designed to contain uninitialized variables that should persist across reboots. The section is placed directly after .bss, under the theory that the size of Circuit Python's .bss + .data is bigger than the bootloader's .bss + .data, so there is less likely to be a conflict. Signed-off-by: Sean Cross <[email protected]>
1 parent 2314f98 commit f002c78

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ports/nrf/boards/common.template.ld

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ SECTIONS
103103
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
104104
} >RAM
105105

106-
/* Uninitialized data section */
106+
/* Zero-initialized data section */
107107
.bss :
108108
{
109109
. = ALIGN(4);
@@ -116,6 +116,19 @@ SECTIONS
116116
_ebss = .; /* define a global symbol at bss end; used by startup code and GC */
117117
} >RAM
118118

119+
/* Uninitialized data section
120+
Data placed into this section will remain unchanged across reboots. */
121+
.uninitialized (NOLOAD) :
122+
{
123+
. = ALIGN(4);
124+
_suninitialized = .; /* define a global symbol at uninitialized start; currently unused */
125+
*(.uninitialized)
126+
*(.uninitialized*)
127+
128+
. = ALIGN(4);
129+
_euninitialized = .; /* define a global symbol at uninitialized end; currently unused */
130+
} >RAM
131+
119132
/* this is to define the start of the heap, and make sure we have a minimum size */
120133
.heap :
121134
{

0 commit comments

Comments
 (0)