i.MX6Q Watchdog Question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX6Q Watchdog Question

2,744件の閲覧回数
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)
7 返答(返信)

990件の閲覧回数
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 件の賞賛

990件の閲覧回数
niklasmolin
Senior Contributor I

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

Thanks,

Niklas

0 件の賞賛

990件の閲覧回数
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 件の賞賛

990件の閲覧回数
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

990件の閲覧回数
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 件の賞賛

990件の閲覧回数
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 件の賞賛

990件の閲覧回数
AnsonHuang
NXP Employee
NXP Employee


Hi, S M

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

0 件の賞賛