i.MX6 QuadLite : Know if watchdog was triggered

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

i.MX6 QuadLite : Know if watchdog was triggered

4,260件の閲覧回数
Alexandre_Ribault
Contributor II

Hello,

 

I'm working on a display TTControl Vision 312, which embedded an i.MX6 QuadLite processor.

I use the watchdog to restart my system, when the display freezes.
It works very well.

In order to validate the system, and for maintenance needing, i need to monitore the number of time the watchdog was triggered.

My system in on Linux ( yocto distribution), and see nothing in my journals about wathcdog using.

It seems I have to check deeper, if possible, to know if watchdog was used during the previous "session".
I looked into datasheet from NXP to get registers adresses used by the watchdog. I found nothing.

Does someone can tell me where I can get these informations ?

By advance, thank you for your answers, 

ラベル(2)
0 件の賞賛
返信
6 返答(返信)

4,195件の閲覧回数
Alexandre_Ribault
Contributor II

I can read the registers WDOGx_WRSR ( adresses 20B_C004 and 20C_0002).
Alexandre_Ribault_0-1736502581332.png

See In attached files, the C code 

As I don't know which one of the watchdog is used by Linux, I checked both.
The return of my console is : 

Alexandre_Ribault_1-1736502947207.png

It 's not what I was especting.
POR is true in most of case.
But I voluntary triggered the watchdog, by a python code, which interacts directly with Linux watchdog driver. (also in attached file). So I expected one the TOUT bit should be to 1/ true.

My question now is, does this register is reliable ?
If not, I think, according IMX6 datasheet, there is no other way to know if Watchdog was triggered (Because the watchdog's counter was not periodicaly reset, which means In my real use case, a freeze)

 




0 件の賞賛
返信

4,186件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Yes, the WTDOG reset when it is triggered but in your app is not reliable.

Regards

0 件の賞賛
返信

4,170件の閲覧回数
Alexandre_Ribault
Contributor II

Can you explain me, in which conditions the bit TOUT of the register WDGx_WRSR is set to TRUE ?

Have  you some code snippet to configure the Wathdog with C by editing directly registers, and generate  watchdog event in order I see the bit TOUT to true ?

Currently I use the Linux configuration  ( /etc/systemd/system.conf) to set the watchdog.
As I said, it's work prefectly, the target is restarted when Linux freezes ( I can generate a Linux crash with the command "echo c > /proc/sysrq-trigger").

But if you give me a reliable solution for my app, I can integrate the hardware configuration  of the watchdog to my app.

 

Otherquestion,  about the forum.

why my attached files are not .... attached Oo ?

 

 

タグ(1)
0 件の賞賛
返信

4,194件の閲覧回数
Alexandre_Ribault
Contributor II

Thanks to an other post (imx6 Watchdog - NXP Community), I got complete datasheet 'file name" and was able to download it from this link :

 MCIMX6D5EZK08AD MCIMX6D7CZK08AD MCIMX6D7CVT08AE MCIMX6D5EYM12AC MCIMX6D5EYM12AD MCIMX6D7CZK08AE Data...

I have now the adresses : 

Alexandre_Ribault_0-1736450163756.png

Then, all are registrer are described.

I will finally know if yes or no, a bit meromizes if the watchdog was triggered.

(Bio_TICFSL, in your code you missed the ">" character. I Assume it launches the watchdog ? Even in this case , I think your code wont permit me to detect a watchdog triggering. I can't use date, because I don't have clock on my target. Each time the target is started, the date started with the value 1er janvier 1970 à 00:00:00 UTC).

 

 

0 件の賞賛
返信

4,221件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

I tested on the latest BSP you can use

echo /dev/watchdog0:while : ; do date ;sleep 1;done

 

But i think this maybe some issue with the freq, please check this thread:

https://community.nxp.com/t5/i-MX-Processors/Why-does-the-watchdog-for-i-MX6ULL-happen-too-soon-in-L...

 

Regards

0 件の賞賛
返信

4,211件の閲覧回数
Alexandre_Ribault
Contributor II

Thank you for your answer Bio_TICFSL.

I think your code doesnt' respond to my need.

Your code display every second a timestamp. I see no link with watchdog.

Maybe the term "triggered" wasn't accurate( I'm French).

By "triggered" I mean the display was restart,  because the watchdog was not periodically reset by system ( due to freeze).

I think a look on the driver of i.MX2 watchdog is more accurate, according to this documentation : 
Watchdog (Linux) | Toradex Developer Center 

"The NXP/Freescale i.MX6 SoC watchdog is the same hardware as in the i.MX2. Because of the i.MX2 having been released earlier, the driver is called imx2-wdt. The watchdog driver creates one device under /dev/watchdog. By default, the watchdog resets the system after 60 seconds."

The kernel of my target is 4.19.
I got linux kernels sources and cheched the file imx2_wdt.c.
This parts of code seems very interessant : 

Alexandre_Ribault_2-1736443016948.png

 

Alexandre_Ribault_1-1736442905243.png

 

When I asked to copilot translate this part in pytho, i said me 

IMX2_WDT_WRSR is a register \O/ yeah.
(And when I wrote this part of  my answer, I see the comment which said it's a register ....)

The rest of work is how to acces register by python on Linux.

If someone can get me the datasheet,  with registers addresses of the Imx6 controller, It would be a pleasure. To ensure the C value is the same as datasheet.

Again, thank you for your answers

 

タグ(1)
0 件の賞賛
返信