PageSourceSearch

https://wiki.luckfox.com/assets/js/96079c22.61472b7a.js

js luckfox.com collected 2026-10-03 19:12:24 UTC 6,180 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdoc_test=self.webpackChunkdoc_test||[]).push([["17314"],{39804(e,t,n){n.r(t),n.d(t,{metadata:()=>i,default:()=>h,frontMatter:()=>a,contentTitle:()=>r,toc:()=>d,assets:()=>c});var i=JSON.parse('{"id":"Luckfox Omni3576/Debian12/Omni3576-pinout/Watcdog","title":"Watchdog","description":"Hardware watchdog for automatic system reset on failure.","source":"@site/docs/Luckfox Omni3576/Debian12/Omni3576-pinout/15. Watcdog.md","sourceDirName":"Luckfox Omni3576/Debian12/Omni3576-pinout","slug":"/Luckfox-Omni3576/Debian12/Omni3576-pinout/Watcdog","permalink":"/Luckfox-Omni3576/Debian12/Omni3576-pinout/Watcdog","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":19,"frontMatter":{"description":"Hardware watchdog for automatic system reset on failure.","title":"Watchdog","slug":"/Luckfox-Omni3576/Debian12/Omni3576-pinout/Watcdog","sidebar_position":19},"sidebar":"omni3576Sidebar","previous":{"title":"RTC","permalink":"/Luckfox-Omni3576/Debian12/Omni3576-pinout/RTC"},"next":{"title":"DSI","permalink":"/Luckfox-Omni3576/Debian12/Omni3576-pinout/DSI"}}'),s=n(74848),o=n(28453);let a={description:"Hardware watchdog for automatic system reset on failure.",title:"Watchdog",slug:"/Luckfox-Omni3576/Debian12/Omni3576-pinout/Watcdog",sidebar_position:19},r,c={},d=[{value:"1. Overview",id:"1-overview",level:2},{value:"Main Functions of a Watchdog:",id:"main-functions-of-a-watchdog",level:3},{value:"2. Usage",id:"2-usage",level:2},{value:"3. Device Tree Overview",id:"3-device-tree-overview",level:2}];function l(e){let t={code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"1-overview",children:"1. Overview"}),"\n",(0,s.jsx)(t.p,{children:"A watchdog is an important hardware or software mechanism that is typically used to monitor the operating status of a system or device. When the system fails to respond or encounters an error, the watchdog performs an automatic reset or triggers specific recovery actions. Its main role is to enhance the system's reliability and stability, preventing the system from entering an unrecoverable state."}),"\n",(0,s.jsx)(t.h3,{id:"main-functions-of-a-watchdog",children:"Main Functions of a Watchdog:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Detecting System Failures"}),': The watchdog timer continuously counts down, and under normal operation, the system is required to periodically "feed" the watchdog (i.e., reset the timer). If the system fails to feed the watchdog within the specified time, the watchdog considers the system to have failed (e.g., due to a freeze or unresponsiveness).']}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Automatic System Reset"}),": When the watchdog detects that the system has failed to feed the watchdog in time, it triggers an automatic system reset, typically restarting the device. This ensures that the system can recover from an error state and avoids prolonged stagnation."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Enhancing System Fault Tolerance"}),": In real-time or embedded systems, the watchdog acts as a last line of defense, automatically recovering the system when unpredictable issues occur in the system software, thus preventing the need for manual intervention."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Preventing Software Lockups"}),": The watchdog can monitor the software's operational status, especially for long-running software, to prevent issues such as dead loops or system hangs. It requires the software to complete certain critical tasks within a specified time; otherwise, the watchdog will trigger a reset."]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"2-usage",children:"2. Usage"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The internal watchdog device is named ",(0,s.jsx)(t.code,{children:"/dev/watchdog"}),". Users can control this device via the ",(0,s.jsx)(t.code,{children:"echo"})," command."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"# Write any content (except uppercase 'V') to enable the watchdog. It needs to be fed (reset) every 44 seconds.\necho A > /dev/watchdog\n\n# Enable the watchdog, and the kernel will automatically feed the watchdog every 22 seconds.\necho V > /dev/watchdog\n"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"3-device-tree-overview",children:"3. Device Tree Overview"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The Watchdog DTS source file is already defined in ",(0,s.jsx)(t.code,{children:"kernel-6.10/arch/arm64/boot/dts/rockchip/rk3576.dtsi"}),", and we can directly use it."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-c",children:'wdt: watchdog@2ace0000 {\n    compatible = "snps,dw-wdt";\n    reg = <0x0 0x2ace0000 0x0 0x100>;\n    clocks = <&cru TCLK_WDT0>, <&cru PCLK_WDT0>;\n    clock-names = "tclk", "pclk";\n    interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;\n    status = "disabled";\n};\n'})}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The device file path is located in ",(0,s.jsx)(t.code,{children:"kernel-6.1/arch/arm64/boot/dts/rockchip/luckfox-omni3576.dts"}),". The code snippet to enable the ",(0,s.jsx)(t.code,{children:"watchdog"})," is as follows:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-c",children:'&wdt{\n        status = "okay";\n};\n'})}),"\n"]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},28453(e,t,n){n.d(t,{R:()=>a,x:()=>r});var i=n(96540);let s={},o=i.createContext(s);function a(e){let t=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.