mirror of https://github.com/ARMmbed/mbed-os.git
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 #2115pull/2917/head
parent
f50e23aea6
commit
e8d67ac530
|
@ -149,13 +149,21 @@ static inline int openmode_to_posix(int openmode) {
|
||||||
return posix;
|
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) {
|
extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
|
||||||
#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
|
#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
|
||||||
// Before version 5.03, we were using a patched version of microlib with proper names
|
// 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
|
// This is the workaround that the microlib author suggested us
|
||||||
static int n = 0;
|
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++;
|
if (!std::strcmp(name, ":tt")) return n++;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* Use the posix convention that stdin,out,err are filehandles 0,1,2.
|
/* 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_main(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" WEAK void mbed_sdk_init(void);
|
|
||||||
extern "C" WEAK void mbed_sdk_init(void) {
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(TOOLCHAIN_ARM)
|
#if defined(TOOLCHAIN_ARM)
|
||||||
extern "C" int $Super$$main(void);
|
extern "C" int $Super$$main(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue