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

Quick Start

  • Getting Started Guide
  • Product Documentation Summary

Software Development

  • SDK Programming Guide
  • API Documentation
  • Solution Programming Guide
  • FAQ Frequently Asked Questions
    • Questions related to development tools
      • 1 Compilation Related
      • 2 Jlink
      • 3 KEIL
      • 4 Ozone
      • 5 SiFli
      • 6 Trace32
      • 7 SystemView
      • 8 Serial Port
      • 9 Source Insight Related
    • Issues concerning chips
      • 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 issue
      • 1 Common Issues in LCD Debugging
      • 2 Common Issues in Sensor Debugging
      • 3 Common Issues in Flash Debugging
      • 4 Common Issues in Motor Debugging
    • Software Debugging Related Issues
      • 1 Log Debugging
      • 2 Online Debugging Methods
      • 3 Dump Memory to Recover Crash Scene
      • 4 Methods for Saving Crash Dump
  • Application Note
    • SF32LB52X Boot and Low Power Process
    • Low Power Development Guide
    • NandFlash_BBM Parsing Guide
  • Best Practices
    • AI XiaoZhi

Hardware Development

  • Sifli Selection Manual
  • Chip Hardware Design Guide
    • SF32LB52x - Hardware Design Guide
    • SF32LB52X - Hardware Design Guide
    • SF32LB56xU - Hardware Design Guide
    • SF32LB56xV - Hardware Design Guide
    • SF32LB58x - Hardware Design Guide
    • SF32LB55x - Hardware Design Guide
  • Development Boards
    • SF32LB52-DevKit-LCD Development Board User Guide
    • Sich Dev Board LCM Adapter Board Guide
    • SF32LB52-DevKit-ULP Development Board User Guide
    • SF32LB52-DevKit-Nano Development Board User Guide
    • SF32LB56-DevKit-LCD Development Board User Guide
    • SF32LB58-DevKit-LCD Development Board User Guide
  • Module

Software Tools

  • Summary of Software and Hardware Tools
    • Firmware Burning Tool Impeller
    • Graphics Conversion Tool
    • Storage Debugging Tools
      • Flash Chipid and Type Configuration Guide
    • Screen Module Debugging
      • Introduction to Screen Modules
      • Screen Module Framework Introduction
      • Directory Structure Introduction
      • Adding Screen Module (1) – Adding Files (Copying Files)
      • Add Screen Module (2) – Modify the Copied Driver File
      • Add Screen Module (3) – Modify Kconfig/Menuconfig
      • Adding Screen Module Operation Examples
      • FAQ
      • Appendix
        • Screen Driver Callback Functions
        • Application Layer vs. Module Driver Layer Function Correspondence Table
        • List of Supported Screen Modules
    • sftool

Product Introduction

  • About SiFli Technologies

On this page

  • 4.1 Watchdog WDT Status After Standby
  • 4.2 Methods to Disable WDT Using Jlink
  • 4.3 Where to Clear the WDT
OpenSiFli/SiFli-Wiki 0 0
Edit this page
  1. SiFli-Wiki /
  2. FAQ Frequently Asked Questions /
  3. Issues concerning chips /
  4. 4 Watchdog Related

4 Watchdog Related¶

4.1 Watchdog WDT Status After Standby¶


alt text

As shown in the code above, the current SDK does not power down the watchdog after entering standby, but the code will stop the WDT. Regardless of how long the sleep duration is, the watchdog will not trigger a reset.
When waking up from standby, the resume case will be executed, and the WDT will be reinitialized, effectively restarting the countdown.

4.2 Methods to Disable WDT Using Jlink¶

  1. Scenario 1: If both Hcpu and Lcpu have watchdogs enabled, and the machine repeatedly restarts, making it impossible to dump memory to diagnose the issue, you can disable the watchdog using Jlink: Execute:

    tools\segger\halt_all_cpu_and_disable_all_wdt_a0.bat
    

    This will disable the WDT for both Hcpu and Lcpu, and halt both CPUs, facilitating memory dumping.

  2. Scenario 2: If you only want to disable the log for Hcpu and allow Hcpu to continue running: Modify the commands in halt_all_cpu_and_disable_all_wdt_a0.jlink corresponding to halt_all_cpu_and_disable_all_wdt_a0.bat as follows:

    connect # Connect Jlink
    w4 0x4004f000 0 # Switch Jlink to Hcpu
    connect # Connect Jlink
    h # Halt Hcpu
    w4  0x40014018  0x51ff8621
    w4  0x4001400C  0x34
    w4  0x40014018  0x58ab99fc
    w4  0x4007c018  0x51ff8621
    w4  0x4007c00C  0x34
    w4  0x4007c018  0x58ab99fc
    g # After the above operations on the WDT registers, continue running Hcpu
    exit
    
  3. Scenario 3: If you only want to disable the log for Lcpu and allow Lcpu to continue running, you can extract and modify a portion of the commands in halt_all_cpu_and_disable_all_wdt_a0.jlink:

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

4.3 Where to Clear the WDT¶

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

  2. When the system enters the idle thread rt_thread_idle_entry due to no tasks being processed, the hook function registered in idle_hook_list will be executed;

__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); // Register the WDT hook function, which will automatically clear the watchdog in the idle thread
}

__ROM_USED void rt_hw_watchdog_pet(void) // Manual function to clear the watchdog, can be called
{
    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.