Stack bottom

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Stack bottom

900件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronkrem on Sun Dec 22 06:01:04 MST 2013
I can find the stack top from the memory map, but how do I find the address of the bottom of the available stack area in an LPCXpresso program? I need these addresses to implement a stack usage monitor within my program.
Regards
0 件の賞賛
返信
2 返答(返信)

876件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronkrem on Sun Jan 05 06:15:42 MST 2014
After some more map file searching I can now setup the stack for background monitoring. Here is the setup code:

#ifdef DEBUG_STACK
    StackBottom = (uint8_t*)((__heaps     & 0xfffffff0) + 0x20);
    StackTop    = (uint8_t*)((__get_MSP() & 0xfffffff0) - 0x20);
    StackPtr = StackTop;
    StackSize = StackTop - StackBottom;
    memset(StackBottom, FLAG_BYTE, StackSize);
#endif


Regards, Ron
0 件の賞賛
返信

876件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Dec 22 10:11:22 MST 2013
This may help you...
http://www.lpcware.com/content/faq/lpcxpresso/heap-checking-redlib
0 件の賞賛
返信