Yuqiang Wang e1498cabc9 SDK build (#47) 5 months ago
..
.settings 4795f3d206 更新fsp为2.2.0 6 months ago
board 4795f3d206 更新fsp为2.2.0 6 months ago
figures 81cbc9d39c "example readme 内容补全" 1 year ago
packages 4795f3d206 更新fsp为2.2.0 6 months ago
rzn 0e9a0dfdbd fix iar link source 6 months ago
rzn_cfg 0e9a0dfdbd fix iar link source 6 months ago
rzn_gen 0e9a0dfdbd fix iar link source 6 months ago
script 4795f3d206 更新fsp为2.2.0 6 months ago
src f4bde77e2a 修复gpt 使用pwm 框架 以及其他示例中hal_entry 中的 主循环内容 1 year ago
.api_xml e7e2582a7c EtherKit 示例工程添加 1 year ago
.config 4795f3d206 更新fsp为2.2.0 6 months ago
.cproject 4795f3d206 更新fsp为2.2.0 6 months ago
.gitignore 43669c1c97 Fixed some known issues 1 year ago
.project e7e2582a7c EtherKit 示例工程添加 1 year ago
.secure_azone e7e2582a7c EtherKit 示例工程添加 1 year ago
.secure_rzone 4795f3d206 更新fsp为2.2.0 6 months ago
.secure_xml 4795f3d206 更新fsp为2.2.0 6 months ago
Kconfig 4795f3d206 更新fsp为2.2.0 6 months ago
README.md e1498cabc9 SDK build (#47) 5 months ago
README_zh.md e1498cabc9 SDK build (#47) 5 months ago
SConscript 0e9a0dfdbd fix iar link source 6 months ago
SConstruct e7e2582a7c EtherKit 示例工程添加 1 year ago
buildinfo.ipcf 0e9a0dfdbd fix iar link source 6 months ago
buildinfo.json 4795f3d206 更新fsp为2.2.0 6 months ago
configuration.xml 4795f3d206 更新fsp为2.2.0 6 months ago
envsetup.sh e7e2582a7c EtherKit 示例工程添加 1 year ago
mklinks.bat e7e2582a7c EtherKit 示例工程添加 1 year ago
mklinks.sh e7e2582a7c EtherKit 示例工程添加 1 year ago
ozone_scons.jdebug 384e7a31df 修复scons固件无法运行的问题,添加ozone调试脚本 1 year ago
project.ewd 0e9a0dfdbd fix iar link source 6 months ago
project.ewp 0e9a0dfdbd fix iar link source 6 months ago
project.ewt 0e9a0dfdbd fix iar link source 6 months ago
project.eww e7e2582a7c EtherKit 示例工程添加 1 year ago
rtconfig.h 4795f3d206 更新fsp为2.2.0 6 months ago
rtconfig.py 384e7a31df 修复scons固件无法运行的问题,添加ozone调试脚本 1 year ago
rzn_cfg.txt 4795f3d206 更新fsp为2.2.0 6 months ago
template.ewd e7e2582a7c EtherKit 示例工程添加 1 year ago
template.ewp 4795f3d206 更新fsp为2.2.0 6 months ago
template.eww e7e2582a7c EtherKit 示例工程添加 1 year ago

README.md

WDT Driver Usage Instructions

English | Chinese

Introduction

This example mainly introduces how to use the WDT (Watchdog Timer) device on the EtherKit.

Hardware Description

None

Software Description

FSP Configuration Instructions

Open the FSP tool and create a new stack, selecting r_wdt.

RT-Thread Settings Configuration

img

Example project description

By performing a watchdog operation in the idle function, we ensure that our program runs as expected.

static void idle_hook(void)
{
    /* 在空闲线程的回调函数里喂狗 */
    rt_device_control(wdg_dev, RT_DEVICE_CTRL_WDT_KEEPALIVE, NULL);
    rt_kprintf("feed the dog!\n ");
}
static int wdt_test(int argc, char *argv[])
{
    rt_err_t ret = RT_EOK;
    char device_name[RT_NAME_MAX];
    /* 判断命令行参数是否给定了设备名称 */
    if (argc == 2)
    {
        rt_strncpy(device_name, argv[1], RT_NAME_MAX);
    }
}

Running

Compilation & Download

RT-Thread Studio: Download the EtherKit resource package in the RT-Thread Studio package manager, then create a new project and compile it.

IAR: First, double-click mklinks.bat to generate links for the rt-thread and libraries folders; then use Env to generate the IAR project; finally, double-click project.eww to open the IAR project and compile it.

After compilation, connect the Jlink interface of the development board to the PC, and download the firmware to the development board.

Running Effects

image-20241125151707999

Notes

None

References

Device and Driver: WDT Device