Skip to content

Commit 96887a4

Browse files
committed
cpu/cortexm_common: add .backup.noinit section
1 parent 15cc7c4 commit 96887a4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cpu/cortexm_common/include/cpu_conf_common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ extern "C" {
162162
* and initialized with user provided data on cold boot.
163163
*/
164164
#define BACKUP_RAM_DATA __attribute__((section(".backup.data")))
165+
166+
/**
167+
* @brief Memory marked with this attribute is retained during deep sleep
168+
* and never initialized.
169+
*/
170+
#define BACKUP_RAM_NOINIT __attribute__((section(".backup.noinit")))
165171
#endif /* CPU_HAS_BACKUP_RAM */
166172

167173
/**

cpu/cortexm_common/ldscripts/cortexm_base.ld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ SECTIONS
229229
. = ALIGN(4);
230230
} > bkup_ram
231231

232+
.backup.noinit (NOLOAD) : ALIGN(4) {
233+
_sbackup_noinit = .;
234+
*(.backup.noinit)
235+
_ebackup_noinit = .;
236+
} > bkup_ram
237+
232238
.heap3 (NOLOAD) : ALIGN(4) {
233239
_sheap1 = . ;
234240
_eheap1 = ORIGIN(bkup_ram) + LENGTH(bkup_ram);

0 commit comments

Comments
 (0)