SiFli Solution is now fully open: a production-ready solution set that accelerates projects from prototype to mass production. Solution Documentation.

SiFli-Wiki SiFli-Wiki SiFli-Wiki
  • User Guide
  • Examples
  • API Documentation
  • About Us
/
  • English
  • 中文

Quick Start

  • Getting Started
  • Product Documentation Summary

Software Development

  • SDK Programming Guide
  • API Documentation
  • Solution Programming Guide
  • FAQ Frequently Asked Questions
    • Development Tool-Related Issues
      • 1 Compilation-Related
      • 2 Jlink
      • 3 KEIL
      • 4 Ozone
      • 5 SiFli
      • 6 Trace32
      • 7 SystemView
      • 8 UART
      • 9 Source Insight-related
    • Chip-Related Issues
      • 1 GPIO-related
      • 2 Timer-Related
      • 3 Interrupt-related
      • 4 Watchdog-Related
      • 5 RTC Related
      • 6 ADC Related
      • 7 I2C-related
      • 8 Low Power-Related
      • 9 PWM
      • 10 System
      • 11 Bluetooth
      • 12 USB-Related
      • 13 UART-Related
      • 14 Dual-core Related
      • 15 I2S-related
      • 13 SPI Related Issues
    • Peripheral Driver Debugging Issues
      • 1 Common LCD Debugging Issues
      • 2 Common Sensor Debugging Issues
      • 3 Common Flash Debugging Issues
      • 4 Common Motor Debugging Issues
    • Software Debugging-Related Issues
      • 1 Log Debugging
      • 2 Online Debugging Method
      • 3 Restoring the Crash Context from a Memory Dump
      • 4 Methods for Saving the Crash Context
  • Application Notes
    • Low-Power Development Guide
    • Application Startup Flow
    • NandFlash_BBM Analysis Guide
    • SF32LB52-DevKit-Core-3p3 Development Board Test Guide
  • Best Practices
    • AI Xiaozhi

Hardware Development

  • SiFli Selection Guide
    • SiFli Chip Model Guide
    • Module Model Guide
  • Chip Hardware Design Guide
    • SF32LB52x Hardware Design Guide
    • SF32LB52X Hardware Design Guide
    • SF32LB56xU Hardware Design Guide
    • SF32LB56xV Hardware Design Guide
    • SF32LB58x Hardware Design Guide
    • SF32 Series UART Automatic Flashing Design
    • SF32LB55x Hardware Design Guide
    • SF32LB52-MOD-1 Module EPD Display Design Guide
  • Development board
    • Development Board Model Guide
    • SF32LB52-DevKit-LCD Development Board User Guide
    • Guide to Making an LCM Adapter Board for SiFli Development Boards
    • Lichuang Huangshan Pi Development Board User Guide
    • SF32LB52-DevKit-Nano Development Board User Guide
    • SF32LB52-DevKit-Core-3p3 Development Board User Guide
    • SF32LB52-OED-6’-EPD Development Board User Guide
    • SF32LB56-DevKit-LCD Development Board User Guide
    • SF32LB58-DevKit-LCD Development Board User Guide
  • Module

Software Tools

  • Software and Hardware Tool Summary
    • Firmware flashing tool Impeller
    • Graphics Conversion Tool
    • Storage debugging tools
      • Flash Chipid and Type Configuration Guide
    • Screen module debugging
      • Screen module introduction
      • Display module framework introduction
      • Directory structure introduction
        • External
        • Built-in
      • Add display module (1) – Add files (copy files)
      • Add display module (2) – Modify the copied driver files
        • Modify the screen driver
        • Modify the screen TP driver
        • Modify the screen backlight driver
      • Add display module (3) – Modify Kconfig/Menuconfig
      • Example operations for adding a display module
        • SF32LB52x-DevKit-LCD example: adding an SPI-LCD (external)
        • Example: adding a QSPI-LCD on 525 (built-in)
        • Example: adding a DPI-LCD on 566 (built-in)
      • FAQ
      • Appendix
        • Display driver callback functions
        • Mapping table between application-layer functions and module driver-layer functions
        • List of adapted display modules
      • LCD frame-rate calculator
    • sftool

Product Introduction

  • About SiFli

On this page

  • 4.1 WDT Watchdog Status After Standby
  • 4.2 Method for Disabling WDT with J-Link
  • 4.3 Where WDT Is Cleared
SiFli-Wiki 0 0
Edit this page
  1. SiFli-Wiki /
  2. FAQ Frequently Asked Questions /
  3. Chip-Related Issues /
  4. 4 Watchdog-Related
View as Markdown Open in ChatGPT Open in Claude

4 Watchdog-Related¶

4.1 WDT Watchdog Status After Standby¶


alt text

In the code above, in the current SDK, after entering standby, the watchdog is not powered off, but the code stops the wdt. No matter how long it sleeps, the watchdog will not take effect and cause a reset.
Waking up from standby will go through the resume case, which will reinitialize the wdt, equivalent to restarting the count.

4.2 Method for Disabling WDT with J-Link¶

  1. Scenario 1: If both Hcpu and Lcpu have enabled the watchdog and the device repeatedly restarts, making it impossible to dump memory to locate the issue, you can use jlink to disable the watchdog, Execute:

tools\segger\halt_all_cpu_and_disable_all_wdt_a0.bat

This will disable the WDT of hcpu and lcpu, and halt both CPUs, making it convenient to dump memory.
2. Scenario 2: If you only want to disable the Hcpu log and allow Hcpu to continue running
Modify the command contents in halt_all_cpu_and_disable_all_wdt_a0.jlink corresponding to halt_all_cpu_and_disable_all_wdt_a0.bat as follows:

connect #连接jlink
w4 0x4004f000 0 #jlink切到Hcpu
connect #连接jlink
h #halt hcpu
w4  0x40014018  0x51ff8621
w4  0x4001400C  0x34
w4  0x40014018  0x58ab99fc
w4  0x4007c018  0x51ff8621
w4  0x4007c00C  0x34
w4  0x4007c018  0x58ab99fc
g #上面操作完WDT寄存器后,go,继续运行Hcpu
exit
  1. Scenario 3: If you only want to disable the Lcpu log and let Lcpu continue running, you can extract part of the commands in halt_all_cpu_and_disable_all_wdt_a0.jlink and make slight modifications.

connect
w4 0x4004f000 1
connect
w4 0x40070000 0 
h
w4  0x40055018  0x51ff8621
w4  0x4005500C  0x34
w4  0x40055018  0x58ab99fc
g
exit

4.3 Where WDT Is Cleared¶

  1. The rt_hw_watchdog_init initialization function registers rt_hw_watchdog_pet as a hook function through rt_hw_watchdog_hook;

  2. When the system has no tasks to process and enters the idle thread rt_thread_idle_entry, it executes the hook function registered in idle_hook_list above;

__ROM_USED void rt_hw_watchdog_init(void)
{
    extern int rt_wdt_init(void);
    rt_wdt_init();
    wdt_dev = rt_device_find("wdt");
    if (wdt_dev)
    {
        rt_err_t err = rt_device_open(wdt_dev, RT_DEVICE_FLAG_RDWR);
        if (err == RT_EOK)
        {
            uint32_t count = WDT_TIMEOUT;
            rt_device_control(wdt_dev, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, &count);
        }
    }
    rt_hw_watchdog_hook(1); //注册wdt钩子函数后,会在idle线程自动清狗
}

__ROM_USED void rt_hw_watchdog_pet(void) //手动清狗函数,可以调用此函数
{
    if (wdt_dev)
    {
        rt_device_control(wdt_dev, RT_DEVICE_CTRL_WDT_KEEPALIVE, NULL);
    }
}

Previous
3 Interrupt-related
Next
5 RTC Related

2025, SiFli

Made with Sphinx and Shibuya theme.