From a11bcdcd5c2f77a85bb3e17b90bd9feee185ed51 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 16 Mar 2020 23:34:15 +0100 Subject: [PATCH] cpu/cortexm_common: define BACKUP_RAM attribute --- cpu/cortexm_common/include/cpu_conf_common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cpu/cortexm_common/include/cpu_conf_common.h b/cpu/cortexm_common/include/cpu_conf_common.h index ea6ffa4429..7e9efe21a8 100644 --- a/cpu/cortexm_common/include/cpu_conf_common.h +++ b/cpu/cortexm_common/include/cpu_conf_common.h @@ -73,6 +73,20 @@ extern "C" { */ #define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".puf"))) +#if CPU_HAS_BACKUP_RAM || DOXYGEN +/** + * @brief Memory marked with this attribute is retained during deep sleep + * and initialized with 0 on cold boot. + */ +#define BACKUP_RAM __attribute__((section(".backup.bss"))) + +/** + * @brief Memory marked with this attribute is retained during deep sleep + * and initialized with user provided data on cold boot. + */ +#define BACKUP_RAM_DATA __attribute__((section(".backup.data"))) +#endif /* CPU_HAS_BACKUP_RAM */ + #ifdef __cplusplus } #endif