diff --git a/targets/TARGET_NUVOTON/TARGET_M480/TARGET_NUMAKER_PFM_M487/mbed_overrides.c b/targets/TARGET_NUVOTON/TARGET_M480/TARGET_NUMAKER_PFM_M487/mbed_overrides.c index 8dbe79c3b5..23838a5003 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/TARGET_NUMAKER_PFM_M487/mbed_overrides.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/TARGET_NUMAKER_PFM_M487/mbed_overrides.c @@ -16,14 +16,6 @@ #include "analogin_api.h" -// NOTE: Ensure mbed_sdk_init() will get called before C++ global object constructor. -#if defined(__CC_ARM) || defined(__GNUC__) -void mbed_sdk_init_forced(void) __attribute__((constructor(101))); -#elif defined(__ICCARM__) - // FIXME: How to achieve it in IAR? -#endif - - void mbed_sdk_init(void) { // NOTE: Support singleton semantics to be called from other init functions @@ -78,8 +70,3 @@ void mbed_sdk_init(void) /* Lock protected registers */ SYS_LockReg(); } - -void mbed_sdk_init_forced(void) -{ - mbed_sdk_init(); -} diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c b/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c index bcf55389e0..4d73907909 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c @@ -62,12 +62,11 @@ extern uint32_t __bss_start__; extern uint32_t __bss_end__; extern void uvisor_init(void); -//#if defined(TOOLCHAIN_GCC_ARM) -//extern void _start(void); -//#endif -extern void software_init_hook(void) __attribute__((weak)); -extern void __libc_init_array(void); -extern int main(void); +#if defined(TOOLCHAIN_GCC_ARM) +extern void _start(void); +#else +#error("For GCC toolchain, only support GNU ARM Embedded") +#endif #endif /* Default empty handler */ @@ -463,17 +462,8 @@ void Reset_Handler_2(void) } } - if (software_init_hook) { - /** - * Give control to the RTOS via software_init_hook() which will also call __libc_init_array(). - * Assume software_init_hook() is defined in libraries/rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h. - */ - software_init_hook(); - } - else { - __libc_init_array(); - main(); - } + _start(); + #endif /* Infinite loop */