Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cpu/cortexm_common/include/cpu_conf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions cpu/esp32/include/cpu_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ extern "C" {
*/
#define PRINTF_BUFSIZ 256

/**
* @brief Memory marked with this attribute is retained during deep sleep
* and initialized with 0 on cold boot.
*/
#define BACKUP_RAM __attribute__((section(".rtc.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(".rtc.data")))

#ifdef __cplusplus
}
#endif /* CPU_CONF_H */
Expand Down
13 changes: 12 additions & 1 deletion cpu/lpc2387/include/cpu_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* directory for more details.
*/


#ifndef CPU_CONF_H
#define CPU_CONF_H

Expand Down Expand Up @@ -127,6 +126,18 @@ extern "C" {
*/
#define NUM_HEAPS (4)

/**
* @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")))

#ifdef __cplusplus
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion tests/periph_backup_ram/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(void)
* counter anyway after wakeup, we did not sleep properly.
*/
static int counter_noinit __attribute__((section(".noinit")));
static int counter __attribute__((section(".backup.bss")));
static int counter BACKUP_RAM;

if (counter == 0) {
puts("\nBackup RAM test\n");
Expand Down