Merge pull request #10390 from PeterKietzmann/pr_mega2560_puf_seed

cpu/atmega_common: add mega2560 puf_sram feature
This commit is contained in:
MichelRottleuthner 2018-11-22 09:57:19 +01:00 committed by GitHub
commit 1be4d15a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,4 @@
FEATURES_PROVIDED += puf_sram
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features
include $(RIOTCPU)/atmega2560/Makefile.features

View File

@ -51,6 +51,11 @@ extern "C" {
#define THREAD_STACKSIZE_IDLE (128)
/** @} */
/**
* @brief Attribute for memory sections required by SRAM PUF
*/
#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".noinit")))
#ifdef __cplusplus
}
#endif

View File

@ -25,6 +25,9 @@
/* For Catchall-Loop */
#include "board.h"
#ifdef MODULE_PUF_SRAM
#include "puf_sram.h"
#endif
/**
* @brief functions for initializing the board, std-lib and kernel
@ -65,6 +68,9 @@ __attribute__((used, naked)) void init8_ovr(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 */
board_init();
/* startup the kernel */