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

Stack & Heap Initialization (RealView MDK-ARM)

There are some codes in the "Startup.s" for "User Initial Stack & Heap".

And, as per this URL
http://www.keil.com/support/man/docs/armlib/armlib_chdegjfd.htm

There are another codes for "Sets up the heap and stack".

It makes me a little confused.

What is the relationship between these two "Stack & Heap Initialization"?

Are they duplicated works, or they have different and important meanings?

Parents
  • Hi Marcus,

    Many Thanks to your help.

    About the "duplication", now I understand I mistaken something.

    At that moment, I learned the startup procedure of the LPC23xx with KEIL MDK-ARM is:

    Startup.s -> __main -> __rt_entry -> C main().
    

    I saw the codes in the "Startup.s" for User Initial Stack & Heap. And KEIL's Document says __rt_entry will set up the heap and stack, so I "assumed" there are another codes for "Sets up the heap and stack".

    Now I guess that, __user_initial_stackheap() is equivalent to __rt_stackheap_init(). And the __user_initial_stackheap() located in Startup.s will only be executed when it is called by __rt_entry.

Reply
  • Hi Marcus,

    Many Thanks to your help.

    About the "duplication", now I understand I mistaken something.

    At that moment, I learned the startup procedure of the LPC23xx with KEIL MDK-ARM is:

    Startup.s -> __main -> __rt_entry -> C main().
    

    I saw the codes in the "Startup.s" for User Initial Stack & Heap. And KEIL's Document says __rt_entry will set up the heap and stack, so I "assumed" there are another codes for "Sets up the heap and stack".

    Now I guess that, __user_initial_stackheap() is equivalent to __rt_stackheap_init(). And the __user_initial_stackheap() located in Startup.s will only be executed when it is called by __rt_entry.

Children