This MR uses an intermediary function `start_app` to call after system
initialization instead of `app_main`.
In RTOS builds, freertos provides `start_app` and calls `app_main`.
In non-RTOS builds, user provides `start_app` directly.
Changes the startup flow to the ff:
hardware -> core libraries init -> other libraries init -> os
init (optional) -> app_main
- hardware init resides in the port layer, and is the entry point
- core libraries init executes init functions of core components
- other libraries init executes init functions of other components (weak
references)
- after other lib is init, the app_main function is called, however,
an OS can wrap the real call to app_main to init its own stuff, and
*then* call the real app_main