M16 IAR CSTACK / ISTACK

Hi !

I want to add some code to check the stack sizes at runtime. while gtting the current end is quite easy with 'C' means .... asm("PUSHC SP"); asm("POP R0"); asm("MOV.W R0,val_usp"); asm("PUSHC ISP"); asm("POP R0"); asm("MOV.W R0, val_isp");

I have problems to determine the begin of the stack This is what can be found in the MAP file

CSTACK 00000400 - 000005FF 200 rel 0 ISTACK 00000600 - 000007FF 200 rel 0

I know there must be a way to acces tehm in 'C' , but all I tried failed. any ideas ?!?!

TIA w.b.

Reply to
analox
Loading thread data ...

s'been just a matter of RTFM , as usual ..:)

#pragma segment = "ISTACK" #pragma segment = "CSTACK"

-> then

cstack_begin = __segment_begin("CSTACK"); istack_begin = __segment_begin("ISTACK");

Reply to
analox

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.