大家好,
使用SPC56EL60L3进行操作时,我注意到当软件看门狗定时器复位器件时,行为与我预期的不同。我期待应用程序重新启动,但我注意到应用程序没有开始运行,直到下一次上电复位。
查看设备文档,我找到了以下句子(第1292页,RM0032):
'如果发生软件看门狗超时事件,则芯片将在复位退出后立即进入SAFE模式。
所以我找到了启动代码,我发现了这个(文件clock.c,第131行,函数spc_clock_init()):
看起来当前运行模式是根据预期的运行模式(即DRUN)和if检查的
它是不同的,调用SPC5_CLOCK_FAILURE_HOOK(),它被映射到irqSysHalt()(基本上是一个
无尽的循环)。这可以解释为什么我的应用程序在SWT重置系统后没有启动。
问题是:在SWT重置后,如果我需要重新启动应用程序(无需循环上电),该怎么办?
我是否可以更改上面的代码以包含SAFE_MODE作为有效的初始状态(以便功能继续)?
还有什么我需要做的吗?
谢谢。
问候
亚历山德罗
以上来自于谷歌翻译
以下为原文
Hello Everyone,
woking with SPC56EL60L3, I no
ticed that when the device gets reset by the software watchdog timer, the behaviour is different than I expected. I was expecting the application to be restarted, but I notice the application does not start running, until the next power-on reset.
Looking at the device documentation, I found the followong sentence (page 1292, RM0032):
'If a software watchdog timeout event occurs, then the chip will always enter SAFE mode immediately after reset exit.'
So I Iooked at the startup code and I found this (file clock.c, row 131, function spc_clock_init() ):
It looks like the current run mode is checked against the expected run mode (which is DRUN) and if
it's different, the SPC5_CLOCK_FAILURE_HOOK() is invoked, which is mapped to irqSysHalt() (basically an
endless loop). This could explain why my application isnot starting after the system being reset by the SWT.
The question is: what if I need my application to restart (without having to cycle the power), after a SWT reset?
Can I just change the above code to include SAFE_MODE as a valid initial state (so that the function goes ahead)?
Is there anything else I need to do?
Thank you.
Regards
Alessandro
0