This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Boot Sequence of ARM Cortex, ARMCC

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).

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.

3) which C-library does keil uses by default, although there is an option for MicroC which is not the default one.

Parents
  • 1) Cortex-M sets up a stack pointer upon reset. At least it loads start address and stackpointer value from 0 and 4. So it is your (or the linker's) responsibility to point this value to RAM. Therefore: SystemInit has a stack to use.

    2) Check library sources. There aren't, so maybe a license issue.

    3) Check the map file.

Reply
  • 1) Cortex-M sets up a stack pointer upon reset. At least it loads start address and stackpointer value from 0 and 4. So it is your (or the linker's) responsibility to point this value to RAM. Therefore: SystemInit has a stack to use.

    2) Check library sources. There aren't, so maybe a license issue.

    3) Check the map file.

Children
No data