cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated Stack not reflected in the STVD7 when using DVP3 (Urgent!)

sjayapal
Associate II
Posted on March 19, 2006 at 23:41

Simulated Stack not reflected in the STVD7 when using DVP3 (Urgent!)

5 REPLIES 5
sjayapal
Associate II
Posted on March 15, 2006 at 10:28

Hi,

Controller Used : ST7FL35

Compiler Used: Cosmic

I am choosing the medium memory model for my project. My understanding is that the stack in this case would in the long range. I am using a linker file and in it the share region(which is the simulated stack) is given as below:

+seg .share -a .bss -m0x64 -is -n stack

and my MAP file is created as below:

start 00000108 end 00000123 length 27 segment stack

I am using the crtsx.s as the startup file. when i run the code in the emulator(DVP3)the stack grows from 0x1ff always and not as per the simulated stack.

When a static memory model is choosen, the rsp command resets the stack pointer to its physical address or to its simulated stack address????

Kindly let me know about this behviour. :o

Thanks and Regards,

Suganya

[ This message was edited by: Suganya on 16-03-2006 04:59 ]

luca239955_st
Associate III
Posted on March 16, 2006 at 05:16

The physical stack is at address 0x1ff in the st7 and that cannot be changed. This physical stack is ALWAYS used for hardware-managed operations, such as storing and retrieving the program counter when calling a function (but not only).

On top of this there is the compiler choice (memory model), to use the real stack or the simulated stack; this is valid ONLY for those operations that are not managed by the hardware, such as storing and retrieving function parameters and local variables.

Hope it helps.

Regards,

Luca (Cosmic)

sjayapal
Associate II
Posted on March 16, 2006 at 10:53

Yup. Thanks.

Like wise the physical stack size also cannot be changed for a controller is it?

For ST7FL35 the memory map defines the physical stack in 0x180 to 0x1FF which is 128 bytes. This size is it fixed ?

Regards,

Suganya.

[ This message was edited by: Suganya on 16-03-2006 15:24 ]

luca239955_st
Associate III
Posted on March 17, 2006 at 12:49

the maximum stack size is fixed by the hw and cannot be changed, but, if your application uses less than the max, the remaining bytes can be used as general purpose RAM (variables) instead of the stack.

Regards,

Luca

sjayapal
Associate II
Posted on March 19, 2006 at 23:41

ok. Thank you.

Regards,

Suganya