Analyze stack for MPC5604B with Codewarrior 2.7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Analyze stack for MPC5604B with Codewarrior 2.7

Jump to solution
1,326 Views
MicroTang
Contributor III

Dear All,

 

I am using Freescale C/C++ Compiler for Embedded PowerPC (version 4.3 build 182) to build my project on MPC5604B. I can read stack information from MAP file, e.g..

 

_stack_addr 40003000

_stack_end  40002a00

 

Does it mean stack bottom is $40002a00 and stack pointer is initialized to 0x4000300? I checked my code, it seems that r1 is used to save stack pointer and the stack grows from high address to low address. Is it right? If there are any documents (notes, manual, guide, etc) describe more details about how does the compiler use the stack of MPC5604B?

 

Thanks in advance for your help!

 

Best Regards

Michael Tang

Labels (1)
0 Kudos
Reply
1 Solution
1,057 Views
stanish
NXP Employee
NXP Employee

Hi MicroTang,

 

You are right the register dedicated to stack pointer is r1 and stack grows downward from high addresses.

This is defined in PPC EABI specification available here:

 

http://www.freescale.com/files/32bit/doc/ref_manual/E500ABIUG.pdf

 

Stanish

View solution in original post

0 Kudos
Reply
2 Replies
1,058 Views
stanish
NXP Employee
NXP Employee

Hi MicroTang,

 

You are right the register dedicated to stack pointer is r1 and stack grows downward from high addresses.

This is defined in PPC EABI specification available here:

 

http://www.freescale.com/files/32bit/doc/ref_manual/E500ABIUG.pdf

 

Stanish

0 Kudos
Reply
1,057 Views
MicroTang
Contributor III

Hello, Stanish

 

Thanks for your kindly help!

 

Best Regards

Michael

0 Kudos
Reply