我用的是10K内存的MSP430芯片。如果内存使用量超过5k,就永远无法将其转换为main()。init代码调用__data20_memzero来清除使用的内存空间。

它看起来像是在内存中递增,并清除字节直到R14=R12。R14为0x34B4。但是R12的最大值是0x2c86,然后重新启动。我通过调试器手动关闭了看门狗,它开始正常运行。我不能认为这是正常的。知道怎么解决这个问题吗?
发布于 2013-07-28 07:22:34
刚发完这封信,我就找到了这份申请说明。
http://supp.iar.com/Support/?note=37778&from=search+result
如果应用程序有大量(超过4k)的全局初始化数据,那么在看门狗超时之前(设备被重置),cstartup内的初始化将不会完成。
和
The solution
The Watchdog timer must be turned off before the initialization phase. This should preferably be done in __low_level_init.
The steps (for F1610, F1611 or F1612)
Copy of the file "low_level_init.c" (from ...\430\src\lib\) to your project directory.
Add the copied "low_level_init.c" file to your project.
Edit your copy of the "low_level_init.c" file
In the file you need to add, either...
#include <msp430x16x.h>
...or add...
#include <io430x16x.h>
You should add, in the __low_level_init() function.
WDTCTL = WDTPW + WDTHOLD;发布于 2013-07-29 13:50:09
正如您已经发现的,根本问题是初始化全局ram所花费的时间太长了。虽然在启动时禁用看门狗确实可以解决问题,但如果你担心WD会被关闭(即使是暂时的),可能会有一个替代方案来缩短该缺陷的时间。
IAR支持扩展__no_init。这告诉编译器,它不需要在初始化例程中包含这些变量。对于初始值不增加任何值的RTOS堆栈或通信缓冲区,它可能很有用。
例如:
__no_init int8_t timerStack[TIMER_STACK_SIZE];
__no_init int8_t displayStack[DISPLAY_STACK_SIZE];https://stackoverflow.com/questions/17905871
复制相似问题