1、
Debugging using IAR Embedded Workbench
Because the IAR debugger is not presently aware of Micrium’s μC/OS-III operating system, the
following error may be reported when the debugger is halted:
Mon Sep 20 16:24:14 2010: The stack pointer for stack 'CSTACK' (currently
0x200023D8) is outside the stack range (0x20000000 to 0x20000400)
Ignore this error message as it does not affect debugging.
原文:http://www.ti.com/lit/ug/spmu164a/spmu164a.pdf
outside the stack range (Memory:0x5400 to Memory:0x5C00)
2、
在使用iar for msp430调试msp430f247的时候,在仿真过程中出现上述的warnning,觉得很奇怪。因为我只是跳入一个子程序而已,不应该占用这么多的堆栈空间。被调用的子程序开头如下:
void spitest()
{
unsigned char firstdata[128];
unsigned char seconddata[128];
unsigned char i;
Led_Init();
Led_On();
Led_Off();
.........
}
仔细查看该段代码对应的汇编,如下:
spitest:
0081E8 8031 0100 sub.w #0x100,SP
0081EC 12B0 871C call #Led_Init
0081F0 12B0 8716 call #Led_On
0081F4 12B0 8710 call #Led_Off
.........
总结:出现该warrning的是编译器的原因,编译器优化初始化数组的方法为占用堆栈,即汇编中的代码“sub.w #100,SP ” ,占用的实在太多,所有导致warrning。同时注意到当spitest子程序跑完后,sp指针会重新恢复正常,所有这个仿真警告是不影响正常程序的。