diff --git a/cpu/cortexm_common/include/cpu_conf_common.h b/cpu/cortexm_common/include/cpu_conf_common.h index 513d53da09..ea6ffa4429 100644 --- a/cpu/cortexm_common/include/cpu_conf_common.h +++ b/cpu/cortexm_common/include/cpu_conf_common.h @@ -68,6 +68,11 @@ extern "C" { #endif /** @} */ +/** + * @brief Attribute for memory sections required by SRAM PUF + */ +#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".puf"))) + #ifdef __cplusplus } #endif diff --git a/sys/puf_sram/puf_sram.c b/sys/puf_sram/puf_sram.c index 2617b2e43f..9b06a63363 100644 --- a/sys/puf_sram/puf_sram.c +++ b/sys/puf_sram/puf_sram.c @@ -19,13 +19,13 @@ #include "puf_sram.h" /* Allocation of the PUF seed variable */ -__attribute__((used,section(".puf"))) uint32_t puf_sram_seed; +PUF_SRAM_ATTRIBUTES uint32_t puf_sram_seed; /* Allocation of the PUF seed state */ -__attribute__((used,section(".puf"))) uint32_t puf_sram_state; +PUF_SRAM_ATTRIBUTES uint32_t puf_sram_state; /* Allocation of the memory marker */ -__attribute__((used,section(".puf"))) uint32_t puf_sram_marker; +PUF_SRAM_ATTRIBUTES uint32_t puf_sram_marker; void puf_sram_init(const uint8_t *ram, size_t len) {