我用的是一个带10K内存的MSP430芯片。如果我的内存使用量超过5K,它就永远无法到达main()。init代码调用__data20_memzero以清除已使用的ram空间。
它看起来像是通过内存递增并清除字节,直到r14=r12。r14是0x34b4。但r12在重新启动并重新启动之前的最大值是0x2c86。我通过调试器手动关闭了看门狗,它开始正常运行。我不认为这是正常的。你知道怎么解决这个问题吗?

最佳答案

刚发完这封信,我就发现了这封申请信
http://supp.iar.com/Support/?note=37778&from=search+result
如果应用程序有大量(超过4k)全局初始化数据,则

看门狗超时(设备复位)。

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;

关于c - 由于看门狗(IAR/MSP430),我的嵌入式应用程序无法完成进入main()的初始化,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17905871/

10-11 21:18