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?
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