In debug,I find that address of local variable is not Stack。below the figure :
And the local variable define in function as follows:
uint8_t i = 0u , j = 0u;
The Ram and Stack define in mc9s12zvl32.prm as follows :
RAM = READ_WRITE 0x001100 TO 0x0013FF;
SHADOW_RAM = READ_WRITE 0x001000 TO 0x001100;
So,I want to know how to define local variables are stored in the stack?
解決済! 解決策の投稿を見る。
Hi Wang.
I just checked your project, but I haven't find stack problem.
As I said before, Stack address is inside the RAM section.
see your map file, we can know stack is allocated from address 0x1100 to 0x11ff.
while variable "i" and "j" are in this range.
Does this answer your questions?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello.
Stack belongs to RAM section. Normally if you define a local variable, it should be automatically allocated in stack.
Can you please send me your demo project thus I can check your memory allocation from my side?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jennie,
I don't have your email,so,I uploaded to Baidu SkyDrive demo project。
tks。
Hi Wang.
I just checked your project, but I haven't find stack problem.
As I said before, Stack address is inside the RAM section.
see your map file, we can know stack is allocated from address 0x1100 to 0x11ff.
while variable "i" and "j" are in this range.
Does this answer your questions?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you Jennie。You are right.
I am mistaken "SHADOW_RAM = READ_WRITE 0x001000 TO 0x001100;" for Stack.
By the way,How do I define stack location?such as in the end of RAM.
http://pan.baidu.com/s/1c2Mjrvq password:i5a7