We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
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.
Hi Per,
Many Thanks to your explanations.
Though I need some time to completely understand these concepts, but I think I've already got some key points.
> Now I guess that, __user_initial_stackheap() is > equivalent to __rt_stackheap_init().
Not really. You have to reimplement (MDK has done that for you) __user_initial_stackheap() to place stack and heap regions.
As far as I understand things, __rt_stackheap_init() needs to be changed if you prefer to implement an entirely new stack/heap management.
I have never had to touch __rt_stackheap_init().
Regards Marcus http://www.doulos.com/arm/