Monitoring Stack Size

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Monitoring Stack Size

2,977 次查看
historysmistory
Contributor I

I am developing an application for the LPC4088 using the LPC-Link2 probe and I am looking for ways to monitor the size of the stack ideally in real time. Any suggestions?

标签 (1)
0 项奖励
回复
2 回复数

2,065 次查看
lpcware
NXP Employee
NXP Employee
bump
0 项奖励
回复

2,065 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

There are a number of ways this might be done.

One idea is to capture the stack pointer from an interrupt routine such as systick. LPCXpresso IDE creates projects using a single stack model for exceptions - but take care that you monitor the intended stack.  Code like the example below could be used the capture the stack:

__STATIC_INLINE uint32_t __get_MSP(void)

{

  register uint32_t __regMainStackPointer     __ASM("msp");

  return(__regMainStackPointer);

}

Once the data has been captured, it could be saved into a global variable, then within LPCXpresso IDE this global variable could be monitored using SWO Datatrace.

Overview of Trace support in LPCXpresso IDE

Yours,

LPCXpresso-support

0 项奖励
回复