我发现imx6的watchdog好像有bug, 我在使用imx6q_sabresd板子上的watchdog
int main(int argc, char *argv[])
{
int i = 5;
int flags;
int timeout = 5;
int ret = 0;
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -1) {
fprintf(stderr, "Watchdog device not enabled.\n");
fflush(stderr);
exit(-1);
}
ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
printf("The timeout was set to %d seconds\n", timeout);
while(1);
//while(i--)
//{
// sleep(8);
// keep_alive();
//}
//ret = write(fd, "V", 1);
//if (ret != 1)
// printf("Send stop wdt fail\n");
close(fd);
}
我屏蔽掉内核 arch/arm/mach-mx6/board-mx6q_sabresd.h 中的 /* MX6Q_PAD_GPIO_1__WDOG2_WDOG_B, */,当系统重启时,T4脚上还有一个低脉冲产生。
|