You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exported project to LPCXpresso IDE (GCC_CR build) doesn't reach to the main() function for baremetal (non-RTOS) build.
Automate test result of the LPC1768 is below:
Original code in the reset vector startup code for GCC_CR is below:
extern "C" void software_init_hook(void) __attribute__((weak));
AFTER_VECTORS void ResetISR(void) {
// snip
SystemInit();
if (software_init_hook) // give control to the RTOS
software_init_hook(); // this will also call __libc_init_array
else {
__libc_init_array();
main();
}
while (1) {;}
}
The software_init_hook symbol is now defined as strong rather than weak, therefore if (software_init_hook) statement is always true even an mbed-rtos library is not linked. i.e. baremetal project.
When I use pre_main symbol which is weakly defined in other static library (mbed-rtos) and it works as expected. I will make PR once my local test has been completed.
The text was updated successfully, but these errors were encountered:
An exported project to LPCXpresso IDE (GCC_CR build) doesn't reach to the main() function for baremetal (non-RTOS) build.
Automate test result of the LPC1768 is below:
This was because the software_init_hook() function was defined here with strong (non-weak) symbol by this change.
43e595a
Original code in the reset vector startup code for GCC_CR is below:
The
software_init_hook
symbol is now defined as strong rather than weak, thereforeif (software_init_hook)
statement is always true even an mbed-rtos library is not linked. i.e. baremetal project.I tried to use a
software_init_hook_rtos
symbol instead which is weakly defined inretarget.cpp
, but this was strongly linked into theResetISR
startup code because they were in the same static library. See: http://stackoverflow.com/questions/23079997/override-weak-symbols-in-static-libraryWhen I use
pre_main
symbol which is weakly defined in other static library (mbed-rtos) and it works as expected. I will make PR once my local test has been completed.The text was updated successfully, but these errors were encountered: