From dbcf59f196326dce74aa383e2b29d8d39bff885f Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 25 Feb 2019 23:00:52 +0100 Subject: [PATCH] cpu/msp430: call newlib _init() in startup script --- cpu/msp430_common/startup.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/cpu/msp430_common/startup.c b/cpu/msp430_common/startup.c index 5a6365ac0e..8c68c0f8dc 100644 --- a/cpu/msp430_common/startup.c +++ b/cpu/msp430_common/startup.c @@ -20,7 +20,11 @@ */ #include + +#include "periph_conf.h" +#include "periph/init.h" #include "kernel_init.h" +#include "stdio_base.h" #include "irq.h" #include "log.h" @@ -28,12 +32,19 @@ extern void board_init(void); __attribute__((constructor)) static void startup(void) { - /* use putchar so the linker links it in: */ - putchar('\n'); - board_init(); - LOG_INFO("RIOT MSP430 hardware initialization complete.\n"); +#ifdef MODULE_NEWLIB + void _init(void); + _init(); +#endif + /* initialize stdio prior to periph_init() to allow use of DEBUG() there */ + stdio_init(); + /* trigger static peripheral initialization */ + periph_init(); + /* continue with kernel initialization */ kernel_init(); + + __builtin_unreachable(); }