INIT: uARM no rtos: Align pre-main initialization steps between TCs

In uARM, the library's hook _platform_post_stackheap_init does not seem to
exist and I couldnot find a documentation describing the initialisation
flow. All we know is that _open is called after RAM init and before the
C++ init, so this is a working placeholder.

This is maybe not acceptable so a uARM lib expert may propose a better
hook to fullfil the requirement.

At least this is a workign setup.

This series should solve issue reported here:
STM32 (At least F401) breaks if Tickers are activated in a global object #2115
pull/2917/head
Laurent MEUNIER 2016-07-11 16:14:03 +02:00 committed by Russ Butler
parent f50e23aea6
commit e8d67ac530
1 changed files with 9 additions and 5 deletions

View File

@ -149,13 +149,21 @@ static inline int openmode_to_posix(int openmode) {
return posix;
}
extern "C" WEAK void mbed_sdk_init(void);
extern "C" WEAK void mbed_sdk_init(void) {
}
extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
// Before version 5.03, we were using a patched version of microlib with proper names
// This is the workaround that the microlib author suggested us
static int n = 0;
static int mbed_sdk_inited = 0;
if (!mbed_sdk_inited) {
mbed_sdk_inited = 1;
mbed_sdk_init();
}
if (!std::strcmp(name, ":tt")) return n++;
#else
/* Use the posix convention that stdin,out,err are filehandles 0,1,2.
*/
@ -516,10 +524,6 @@ extern "C" WEAK void mbed_main(void);
extern "C" WEAK void mbed_main(void) {
}
extern "C" WEAK void mbed_sdk_init(void);
extern "C" WEAK void mbed_sdk_init(void) {
}
#if defined(TOOLCHAIN_ARM)
extern "C" int $Super$$main(void);