繁体   English   中英

将watchdog_set_period设置为最大值会导致重新启动

[英]Setting up watchdog_set_period to max value causes reboot

关于看门狗定时器如何在嵌入式环境中工作,我并没有太多关于看门狗定时器的相关问题

其中一个宏中定义的最大超时值为55,当我们尝试从watchdog_set_period函数设置此值时,我们的电路板正在重新启动

#define Max_time_out 55

watchdog_set_period(int period)//设置看门狗超时计数器

其中period = 55

现在是预期的事情或重启的原因是什么

我们正在将这段时间值写入我们通过文件描述符访问的某个驱动程序。

链接在看门狗定时器上说明了这种描述。

A watchdog timer is a piece of hardware that can be used to automatically detect software anomalies and reset the processor if any occur. Generally speaking, a watchdog timer is based on a counter that counts down from some initial value to zero. The embedded software selects the counter's initial value and periodically restarts it. If the counter ever reaches zero before the software restarts it, the software is presumed to be malfunctioning and the processor's reset signal is asserted. The processor (and the embedded software it's running) will be restarted as if a human operator had cycled the power.

您尚未发布代码,因此我们无法判断问题究竟是什么。 如果您已编写代码,请检查您的代码是否导致任何导致看门狗定时器重置的问题。

看门狗定时器是一种特殊类型的定时器,通常位于嵌入式系统上,用于检测运行的软件/固件何时挂起某些任务。 看门狗定时器基本上是一个倒数计时器,从一些初始值减少到零。 达到零时,看门狗定时器会理解系统已挂起并重置。

因此,正在运行的软件必须定期更新看门狗定时器(在无限循环中)并使用新值来阻止它达到零并导致复位。 当正在运行的软件锁定执行某项任务且无法更新(刷新失败)看门狗定时器时,定时器最终将达到零并且将发生重置/重启。

总而言之,如果启用看门狗定时器,则需要定期刷新看门狗定时器。 否则,当看门狗定时器到期时,电路板将重新启动。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM