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,
I can read the registers WDOGx_WRSR ( adresses 20B_C004 and 20C_0002).
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 :
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)
Hello,
Yes, the WTDOG reset when it is triggered but in your app is not reliable.
Regards
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 ?
Thanks to an other post (imx6 Watchdog - NXP Community), I got complete datasheet 'file name" and was able to download it from this link :
I have now the adresses :
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).
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:
Regards
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 :
When I asked to copilot translate this part in pytho, i said me