hellonsn 发表于 2018-7-24 16:24:08

stm32f0 wwdog problem

WWDG HAS an EWI (early wakeup interrupt) that we can use ? the question is can we refresh the downcounter in the EWI interrupt handler function to avoid system reset ??
I tried to do it ,but seems it doesn't work , and after the interrupt , the WWDG triggerred a system reset even the downcounter has been refreshed in the interrtupt handler.
So could anyone give some advice on that situation?? thanks a lot.

toofree 发表于 2018-7-24 17:28:01

窗口看门狗,只有在红框时间内,才允许刷新看门狗寄存器(即喂狗),其余时间是不允许喂狗的。一旦达到T6时间,仍然没有喂狗的话,将产生复位。




zwjchinayids 发表于 2018-7-24 18:00:38

hello! WWDG 是有区间的,你必须在时间段内喂狗   早了和晚了都会复位的,so你要获取 当前时间进行对比
.sorry   I Cann't English ,I'm fromChina

zwjchinayids 发表于 2018-7-24 18:02:09

zwjchinayids 发表于 2018-7-24 18:00
hello! WWDG 是有区间的,你必须在时间段内喂狗   早了和晚了都会复位的,so你要获取 当前时间进行对比
.s ...

建议您先看下IWDG后进行比较

hellonsn 发表于 2018-7-25 07:36:17

zwjchinayids 发表于 2018-7-24 18:00
hello! WWDG 是有区间的,你必须在时间段内喂狗   早了和晚了都会复位的,so你要获取 当前时间进行对比
.s ...

hello,I set the window value = 0x7f , which is the max value , and set T = 0X7F as well , when the counter reaches 0x40 , triggering a EWI interrupt, my question is in the EWI interrupt handler , is it possible to refresh the T counter ?
thanks.

hellonsn 发表于 2018-7-25 07:36:46

toofree 发表于 2018-7-24 17:28
窗口看门狗,只有在红框时间内,才允许刷新看门狗寄存器(即喂狗),其余时间是不允许喂狗的。一旦达到T6时 ...

hello,I set the window value = 0x7f , which is the max value , and set T = 0X7F as well , when the counter reaches 0x40 , triggering a EWI interrupt, my question is in the EWI interrupt handler , is it possible to refresh the T counter ?
thanks.

hellonsn 发表于 2018-7-25 09:08:28

From the user reference , we can see that:

In some applications, the EWI interrupt can be used to manage a software system check
and/or system recovery/graceful degradation, without generating a WWDG reset. In this
case, the corresponding interrupt service routine (ISR) should reload the WWDG counter to avoid the WWDG reset, then trigger the required actions.

But when I reload the WWDG counter , a system reset happened after the interrupt.

发表于 2018-7-25 09:24:30

本帖最后由 安 于 2018-7-25 09:35 编辑

hellonsn 发表于 2018-7-25 09:08
From the user reference , we can see that:

In some applications, the EWI interrupt can be used to...
hello,I want to see your code how to used.for example:

zwjchinayids 发表于 2018-7-25 15:17:11

hellonsn 发表于 2018-7-25 07:36
hello,I set the window value = 0x7f , which is the max value , and set T = 0X7F as well , w ...

不可以的!,这样做可能会出现WWDG误判。
在"主程序喂狗论"中,最"强有的理论依据"就是---"程序跑飞了可是中断不一定会死" (中断一般都有自己固定不变的中断向量地址,这样即使主程序飞,中断也能正确地跳入自己的轨道继续运行.)

我没懂你说的中断是哪种中断.但是你可以修改 看门狗回调函数。不知道我理解你题意了没。

zwjchinayids 发表于 2018-7-25 15:19:59

hellonsn 发表于 2018-7-25 07:36
hello,I set the window value = 0x7f , which is the max value , and set T = 0X7F as well , w ...

抱歉,刚刚没看到你说的EWI,发送出去才看到了
这样是可以的,清除标志位后等待一下标志位真正清除,然后再喂狗,退出中断。保证中断只执行一次。
页: [1] 2
查看完整版本: stm32f0 wwdog problem