i.MX6Q Watchdog Question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.MX6Q Watchdog Question

3,302 次查看
PaulDeMetrotion
Senior Contributor I

I have a Linux BSP that was built with a custom board file that includes the following line which should load the watchdog timer.

    

     imx6q_add_imx2_wdt(0, NULL);

During boot I get the following console message.

     imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)

Problem is the timer is not enabled and has not loaded 60s into the timer. Does the WD timer start automatically or does it need to be manually started? I do have the following device available- /dev/watchdog.

7 回复数

1,548 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi, Paul

     The watchdog timer need to be enabled manually from userspace, need to call IOCTLs of watchdog to enable it. The message you mentioned is just to load the watchdog driver, but it is not enabled. Our unit_test has wdt_driver_test.out, you can try that.

0 项奖励
回复

1,548 次查看
niklasmolin
Senior Contributor I

Can I enable the watchdog from u-boot, in case something happens when the kernel starts up?

Thanks,

Niklas

0 项奖励
回复

1,548 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi, Niklas

     Yes, you can enable watchdog from u-boot, but the concern is that uboot is a single thread program, where can you service the wdog timer? The service must be done in dedicated period related to the timeout value you set to wdog timer.

0 项奖励
回复

1,548 次查看
niklasmolin
Senior Contributor I

Hi Yongcai.

The idea is that it should be enabled right before the u-boot starts the Linux kernel.

Then it should have enough time before the Linux kernel "toggle" the watchdog so it won't trigger.

/Niklas

1,548 次查看
AnsonHuang
NXP Employee
NXP Employee

hi, Niklas

     I think it should be OK. But the question is you need to enable wdog in uboot by configuring its register, and in linux kernel of wdog driver, you can skip the initialization of wdog timer if it is already enabled in uboot, just make sure the service thread is running.

0 项奖励
回复

1,548 次查看
sebimohan
Contributor III

Hi Yongcai,


If watchdog is enabled from uboot by configuring its registers, is there any specific needs for enabling its clock before that??


Thanks

SM

0 项奖励
回复

1,548 次查看
AnsonHuang
NXP Employee
NXP Employee


Hi, S M

     No need, I think wdog's clk is always enabled. You can have a try.

0 项奖励
回复