IAR FreeRTOS stack checking

sgardner123 wrote on Thursday, March 08, 2012:

Hello,

I am using IAR EWARM 6.30.6 with the FreeRTOS and OpenRTOS plugin (v2.0.0.0) and developing on a TI Stellaris EK-LM3S9D92 board. How do I get the stack checking to turn on. Right now the “On” and “Off” menu items are dimmed out. Also, in the Tasks window’s “Min Free Stack”, every task is “Off”. In my code I have:

#define configCHECK_FOR_STACK_OVERFLOW 2

I also noticed that the “Top of Stack” is not really the top of the stack for my setup because when single stepping, I see the SP go higher when popping the stack than what is listed in the column “Top of Stack”.

Thanks in advance!

rtel wrote on Saturday, March 10, 2012:

How do I get the stack checking to turn on. Right now the “On” and “Off” menu items are dimmed out.

Try right clicking on the column in the table itself.  There is a forum for state viewer support on the highintegritysystems.com web site.

I also noticed that the “Top of Stack” is not really the top of the stack for my setup because when single stepping, I see the SP go higher when popping the stack than what is listed in the column “Top of Stack”.

On the ARM the stack grows down from high memory.  I would therefore expect to see the start of stack being a lower value than the current top of stack, and the stack pointer to grow away from the start of stack (as functions are entered) value by becoming a larger number, and shrink toward the start of stack value (as functions are exited) by becoming a smaller number.  I think that is the behaviour your are reporting, and therefore the expected behaviour.

Regards.