diff --git a/cpu/cortexm_common/include/cpu_conf_common.h b/cpu/cortexm_common/include/cpu_conf_common.h index 6bd2b7ab33fc..76e8f44a88ed 100644 --- a/cpu/cortexm_common/include/cpu_conf_common.h +++ b/cpu/cortexm_common/include/cpu_conf_common.h @@ -162,6 +162,12 @@ extern "C" { * and initialized with user provided data on cold boot. */ #define BACKUP_RAM_DATA __attribute__((section(".backup.data"))) + +/** + * @brief Memory marked with this attribute is retained during deep sleep + * and never initialized. + */ +#define BACKUP_RAM_NOINIT __attribute__((section(".backup.noinit"))) #endif /* CPU_HAS_BACKUP_RAM */ /** diff --git a/cpu/cortexm_common/ldscripts/cortexm_base.ld b/cpu/cortexm_common/ldscripts/cortexm_base.ld index 6dc5e0428f6b..4c730b003501 100644 --- a/cpu/cortexm_common/ldscripts/cortexm_base.ld +++ b/cpu/cortexm_common/ldscripts/cortexm_base.ld @@ -229,6 +229,12 @@ SECTIONS . = ALIGN(4); } > bkup_ram + .backup.noinit (NOLOAD) : ALIGN(4) { + _sbackup_noinit = .; + *(.backup.noinit) + _ebackup_noinit = .; + } > bkup_ram + .heap3 (NOLOAD) : ALIGN(4) { _sheap1 = . ; _eheap1 = ORIGIN(bkup_ram) + LENGTH(bkup_ram);