omap L138自带的看门狗驱动如何写,哪有这方面的资料,谢谢!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好,
可以参考下面omap-l138 starterware中的watchdog例程。
http://www.ti.com/tool/starterware-dsparm
driver.lib并没有用到watchdog.c源代码, 而是用的timer.c源码。
WDT例程的使用介绍,可以参考下面的starterware user guide.
http://processors.wiki.ti.com/index.php/SitaraWare_01.00.00.09_User_Guide#Timer
另外,还可以参考下面两篇关于starterware的介绍。
http://processors.wiki.ti.com/index.php/Quick_Start_Guide_StarterWare_01.10.XX.XX_%28supports_OMAPL138%29
http://processors.wiki.ti.com/index.php/StarterWare_Getting_Started_01.10.XX.XX
http://software-dl.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/DaVinci_03_21/03_21_00_04/index_FDS.html中的例子我的网页下载不了呀,
如果您方便能发我邮箱吗: liqiu7927@sina.com,万分感谢!
已经编译出了有watchdog的dev的内核了,我写了一个小的喂狗ko,不知道对不对,大侠您看看
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <sys/io.h> //beep use it #include <sys/ioctl.h>
#define ENABLE_IOCTL_FUNC
#undef ENABLE_IOCTL_FUNC
int main(void)
{
int fd = open("/dev/watchdog", O_WRONLY);
int ret = 0;
if (fd == -1) { perror("watchdog error\n"); exit(EXIT_FAILURE); }
while (1)
{
#ifdef ENABLE_IOCTL_FUNC
ioctl(fd, WDIOC_KEEPALIVE, 0);
#else
ret = write(fd, "\0", 1);
if (ret != 1) { ret = -1; break; }
ret = fsync(fd);
if (ret) { break; }
#endif
sleep(10);
}
close(fd);
return ret;
}
谢谢!