From 76f12b1f69a448fd751deb141ec2a4893b30ecc4 Mon Sep 17 00:00:00 2001 From: Pierre-noel Bouteville Date: Thu, 14 Jul 2016 07:28:38 -0600 Subject: [PATCH] I'm using syslog through ITM. In this case syslog_channel function is call before ram initialisation in stm32_clockconfig. But syslog channel uses a global variable that is reset to default by the RAM initialization. --- arch/arm/src/efm32/efm32_clockconfig.c | 3 --- arch/arm/src/efm32/efm32_start.c | 6 ++++++ arch/arm/src/stm32/stm32_start.c | 6 ++++++ arch/arm/src/stm32/stm32f40xxx_rcc.c | 1 - 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/efm32/efm32_clockconfig.c b/arch/arm/src/efm32/efm32_clockconfig.c index 5ecdf03c12f..aeef784326b 100644 --- a/arch/arm/src/efm32/efm32_clockconfig.c +++ b/arch/arm/src/efm32/efm32_clockconfig.c @@ -909,9 +909,6 @@ static inline void efm32_itm_syslog(void) efm32_enable_auxhfrco(); - /* Then perform ARMv7-M ITM SYSLOG initialization */ - - itm_syslog_initialize(); } #else # define efm32_itm_syslog() diff --git a/arch/arm/src/efm32/efm32_start.c b/arch/arm/src/efm32/efm32_start.c index f62e1461d51..59c45afaa32 100644 --- a/arch/arm/src/efm32/efm32_start.c +++ b/arch/arm/src/efm32/efm32_start.c @@ -275,6 +275,12 @@ void __start(void) showprogress('C'); +#ifdef CONFIG_ARMV7M_ITMSYSLOG + /* Perform ARMv7-M ITM SYSLOG initialization */ + + itm_syslog_initialize(); +#endif + /* Perform early serial initialization */ up_earlyserialinit(); diff --git a/arch/arm/src/stm32/stm32_start.c b/arch/arm/src/stm32/stm32_start.c index 480d5f58b46..ac16478b337 100644 --- a/arch/arm/src/stm32/stm32_start.c +++ b/arch/arm/src/stm32/stm32_start.c @@ -282,6 +282,12 @@ void __start(void) showprogress('C'); +#ifdef CONFIG_ARMV7M_ITMSYSLOG + /* Perform ARMv7-M ITM SYSLOG initialization */ + + itm_syslog_initialize(); +#endif + /* Perform early serial initialization */ #ifdef USE_EARLYSERIALINIT diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index 3d259ec5c39..347d8a3d62b 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -919,7 +919,6 @@ static inline void rcc_itm_syslog(void) modifyreg32(STM32_DBGMCU_CR, DBGMCU_CR_TRACEMODE_MASK, DBGMCU_CR_ASYNCH | DBGMCU_CR_TRACEIOEN); - itm_syslog_initialize(); } #else # define rcc_itm_syslog()