i.MX6Q Watchdog Question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6Q Watchdog Question

2,739 Views
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 Replies

985 Views
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 Kudos

985 Views
niklasmolin
Senior Contributor I

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

Thanks,

Niklas

0 Kudos

985 Views
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 Kudos

985 Views
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

985 Views
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 Kudos

985 Views
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 Kudos

985 Views
AnsonHuang
NXP Employee
NXP Employee


Hi, S M

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

0 Kudos