TI中文支持网
TI专业的中文技术问题搜集分享网站

强制中止或者退出看门狗watchdog测试程序,为什么系统没有复位?

看门狗测试程序如下:
int fd;

void catch_int(int signum)
{signal(SIGINT, catch_int);printf("In signal handler\n");if(0 != close(fd))printf("Close failed in signal handler\n");elseprintf("Close succeeded in signal handler\n");
}



int main(int argc, const char *argv[]) {int sleep_time = atoi(argv[1]);int data = 0;int ret_val;//signal(SIGINT, catch_int);fd=open("/dev/watchdog",O_WRONLY);if (fd==-1) {perror("watchdog");return 1;}ret_val = ioctl (fd, WDIOC_GETTIMEOUT, &data);if (ret_val) {printf ("\nWatchdog Timer : WDIOC_GETTIMEOUT failed");}else {printf ("\nCurrent timeout value is : %d seconds\n", data);}data = 10;ret_val = ioctl (fd, WDIOC_SETTIMEOUT, &data);if (ret_val) {printf ("\nWatchdog Timer : WDIOC_SETTIMEOUT failed");}else {printf ("\nNew timeout value is : %d seconds", data);}ret_val = ioctl (fd, WDIOC_GETTIMEOUT, &data);if (ret_val) {printf ("\nWatchdog Timer : WDIOC_GETTIMEOUT failed");}else {printf ("\nCurrent timeout value is : %d seconds\n", data);}while(1){if (1 != write(fd, "\0", 1)){printf("Write failed\n");break;}elseprintf("Write succeeded\n");sleep(sleep_time);}if (0 != close (fd))printf("Close failed\n");elseprintf("Close succeeded\n");return 0;
}

测试如下:
由于硬件没有使用RSTOUT引脚,用的是软件看门狗,
./sawatchdog 3,只要时间小于10s,系统不会复位,
如果./sawatchdog 15,时间大于10,系统复位。
这些测试正常,但是如果测试程序运行过程中,按ctrl+c按键中止程序运行,或者killall sawatchdog,系统就一直不会复位,
为什么?谢谢!

Shine:

请问你是想用software watchdog来复位是吗?在config文件中有没有 enable CONFIG_SOFT_WATCHDOG, disable CONFIG_OMAP_WATCHDOG?

请问哪里有说明ctrl+c或者killall sawatchdog会复位整个DSP芯片?

Shine:

回复 Shine:

请看下面e2e上的回复。http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/637239/2351046#2351046

赞(0)
未经允许不得转载:TI中文支持网 » 强制中止或者退出看门狗watchdog测试程序,为什么系统没有复位?
分享到: 更多 (0)