找回密码
 立即注册

QQ登录

只需一步,快速开始

打印 上一主题 下一主题
开启左侧

[NUC980] Enabling Watchdog Timer on NUC980

[复制链接]
跳转到指定楼层
楼主
admin 发表于 前天 13:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

The NUC980 series supports a hardware watchdog timer (WDT), which can be used to improve system robustness by resetting the system in the event of a software fault. However, the method of enabling the WDT differs depending on the chip package.


Hardware Pin Limitation (PG3)
  • LQFP128 & LQFP216: Has a PG3 pin which can be used to configure whether the watchdog is enabled during boot via hardware.
  • LQFP64: Does not have PG3 — therefore, watchdog must be enabled via software (U-Boot).

Enabling WDT in U-Boot (for LQFP64 or software control)1. Configure U-Boot to Enable NUC980 Watchdog Driver

$ make uboot-menuconfig

Navigate to:



Device Drivers --->  
  • NUC980 Watchdog

    Save and exit.

    2. Rebuild U-Boot$ make uboot-rebuild
    $ make

    After this, U-Boot will include the NUC980 watchdog support.


    Controlling WDT Activation via env.txt

    In your U-Boot environment file (env.txt), add one of the following:

    • To disable WDT at boot:

    watchdog=off # or watchdog=0

    • To enable WDT at boot:
    watchdog=on # or watchdog=1 # or any non-zero, non-off string

    If watchdog is undefined or set to any value other than off or 0, the watchdog timer will be enabled.


    Default Timeout Behavior

    By default, the watchdog configuration in U-Boot uses the following:

    • Clock source: PCLK2 / 4096
    • Timeout count: 1,000,000 ticks

    Given:

    • PCLK2 = 75 MHz
    • WDT clock = 75,000,000 / 4096 ≈ 18,310.5 Hz
    • Timeout = 1,000,000 / 18,310.5 ≈ 54.6 seconds

    You may modify this behavior in the U-Boot source if needed:




    buildroot/output/build/uboot-custom/drivers/watchdog/nuc980_wdt.c

    Reference:
    https://github.com/OpenNuvoton/NUC970_U-Boot_v2016.11/blob/master/drivers/watchdog/nuc980_wdt.c


    Linux Kernel Consideration

    If WDT is enabled by U-Boot, the Linux kernel must either:

    • Periodically reset the watchdog timer during boot and runtime, or
    • Disable the watchdog timer once the kernel is up and running.

    Since the WDT was software-activated, it can also be cleanly disabled by the Linux kernel.


    Documentation Reference
    • Watchdog Register Map: Refer to the Watchdog Timer chapter in the [NUC980 Technical Reference Manual (TRM)].
    • WDT Control in U-Boot: Refer to U-Boot driver source linked above.

    If you need help with modifying the timeout behavior or integrating WDT into your Linux application, please let us know.


  • 分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏 顶 踩
    牛卧堂
    回复

    使用道具 举报

    高级模式
    B Color Image Link Quote Code Smilies |上传

    本版积分规则

    新唐MCU