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

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