Skip to content
Snippets Groups Projects
Unverified Commit 1be4d15a authored by MichelRottleuthner's avatar MichelRottleuthner Committed by GitHub
Browse files

Merge pull request #10390 from PeterKietzmann/pr_mega2560_puf_seed

cpu/atmega_common: add mega2560 puf_sram feature 
parents b6c5963c 8d11ca41
No related branches found
No related tags found
No related merge requests found
FEATURES_PROVIDED += puf_sram
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features include $(RIOTBOARD)/common/arduino-atmega/Makefile.features
include $(RIOTCPU)/atmega2560/Makefile.features include $(RIOTCPU)/atmega2560/Makefile.features
...@@ -51,6 +51,11 @@ extern "C" { ...@@ -51,6 +51,11 @@ extern "C" {
#define THREAD_STACKSIZE_IDLE (128) #define THREAD_STACKSIZE_IDLE (128)
/** @} */ /** @} */
/**
* @brief Attribute for memory sections required by SRAM PUF
*/
#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".noinit")))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
/* For Catchall-Loop */ /* For Catchall-Loop */
#include "board.h" #include "board.h"
#ifdef MODULE_PUF_SRAM
#include "puf_sram.h"
#endif
/** /**
* @brief functions for initializing the board, std-lib and kernel * @brief functions for initializing the board, std-lib and kernel
...@@ -65,6 +68,9 @@ __attribute__((used, naked)) void init8_ovr(void) ...@@ -65,6 +68,9 @@ __attribute__((used, naked)) void init8_ovr(void)
*/ */
__attribute__((used)) void reset_handler(void) __attribute__((used)) void reset_handler(void)
{ {
#ifdef MODULE_PUF_SRAM
puf_sram_init((uint8_t *)RAMEND-SEED_RAM_LEN, SEED_RAM_LEN);
#endif
/* initialize the board and startup the kernel */ /* initialize the board and startup the kernel */
board_init(); board_init();
/* startup the kernel */ /* startup the kernel */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment