mirror of https://github.com/ARMmbed/mbed-os.git
INIT:GCC no rtos: Align pre-main initialization steps between TCs
Various toolchains supported in MBED don't follow the same initialization steps. This can have impacts on platform behavior. For STM32, it is needed to call the HAL_Init() _after_ the RAM has been initialized (sdata from flash / zero initialized data) and _before_ the C++ objects are being created, especially if those objects require support of tickers for instance. In GCC, this is easily done because SystemInit is called after the ram initialisation, so HAL_Init does not need to called from mbed_sdk_init. this is covered by the changes in mbed_overrides.c files. This series should solve issue reported here: STM32 (At least F401) breaks if Tickers are activated in a global object #2115pull/2917/head
parent
cb9a4b124b
commit
fe9d3174bf
|
@ -31,8 +31,8 @@
|
||||||
void mbed_sdk_init() {
|
void mbed_sdk_init() {
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
// Need to restart HAL driver after the RAM is initialized
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
// Need to restart HAL driver after the RAM is initialized
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
// Need to restart HAL driver after the RAM is initialized
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,10 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
// Need to restart HAL driver after the RAM is initialized
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,8 +35,10 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
// Need to restart HAL driver after the RAM is initialized
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,4 +32,8 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,10 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
|
HAL_Init();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_XDOT_L151CC)
|
#if defined(TARGET_XDOT_L151CC)
|
||||||
if (PWR->CSR & PWR_CSR_SBF) {
|
if (PWR->CSR & PWR_CSR_SBF) {
|
||||||
|
|
|
@ -32,4 +32,8 @@ void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
// Update the SystemCoreClock variable.
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
#if !defined(TOOLCHAIN_GCC_ARM)
|
||||||
|
// Need to restart HAL driver after the RAM is initialized
|
||||||
|
HAL_Init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue