簡體   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