I have few queries regarding ARM Cortex boot sequence. I am using Keil mdk-5 with tm4c123gh6pm Microcontroller. While going through assembly startup (startup_xx.S) code, the following sequence is given.
Reset_Handler -> SystemInit ->__main
From Disassembly of source code, from bellow image
and from ARM Compiler C Library Startup and Initialization, the sequence after __main is as follow:
__main -> __rt_entry -> __user_setup_stackheap() -> __rt_stackheap_init() ..... main()
My questions are:
1) Why SystemInit which is a C-funtion, may require stack, is called before even stack and heap are initialized (__rt_entry initialize stack as above function calls).
1)
SystemInit
2) where can i find the implementation of __rt_entry,__user_setup_stackheap(), __rt_stackheap_init() functions. some of them are declared in rt_misc.h in Keil ARMCC but couldn't find their definitions.
2)
__rt_entry,__user_setup_stackheap(), __rt_stackheap_init()
rt_misc.h
Keil ARMCC
3) which C-library does keil uses by default, although there is an option for MicroC which is not the default one.
Thanks Joseph Yiu. default may be libc.