ChibiOS/RT provides its own generic startup file for the ARM Cortex-Mx port. Of course it is not mandatory to use it but care should be taken about the startup phase details.
The startup process, as implemented, is the following:
__early_init()is invoked, if the symbol is not defined then an empty default routine is executed (weak symbol).
__cmainthat performs the required initializations before invoking the