How can I distinguish what caused a reset of the iMx7? Specifically i would like to figure out whether it was a power cycle, soft reset or a wachtdog reset.
I guessed that uboot should inform me about the reset reason and that I could use the uboot environment to pass the information to the kernel. However uboot always reports “Reset cause: POR” even though the reset was caused by the watchdog (hardware watchdog of iMX7).
Best regards,
Michael
HI @michaelg
Unfortunately, Software Reset is not working on the SoC i.MX 7 as described in the errata of NXP. So it is not possible to detect Software Reset from SoC. This Software Reset issue is also discussed here.
That’s why the SoC is reset through the Power Supply which uses the Reset Line of the SoC, thus no Reset Information can be saved in the SoC. Further the Watchdog Reset is also done by the external Power Supply aka PMIC. The Documentation about the Watchdog of the Colibri iMX7 can be found here.
At the moment, if the module is reset, you will only get POR (Power On Reset) as reset reason, since the driver for the PMIC is not providing any Information about the exact reset reason. We will check internally if it is possible to differentiate POR from WDG Reset and integrate a solution in the next BSP release. You can check in the future the planing for this feature at this page.
Best regards, Jaski
Thanks @jaski.tx for the detailed answer.
hi @jaski.tx
I want to figure out if the reset was caused by a power cycle, soft reset or a wachtdog reset. The most important use case is to figure out if a watchdog reset occurred.
hi @michaelg
Could you state, why you need this feature. What is your application? Do you have a timeline for this?
Hi @michaelg
Could you answer the questions above, please? Thanks.
Hi @jaski.tx
I do have an actual project where this feature would be very useful. The device will be released on the market in April of this year. The feature would be especially useful in case of unexpected resets of the OS.
How would a solution in your BSP work if it the feature is not supported by the SoC? Would it be implemented by queering the PMIC?
Thanks, Michael
hi @michaelg
Thanks for your Input.
The feature would be especially useful in case of unexpected resets of the OS. How would a solution in your BSP work if it the feature is not supported by the SoC?
You can write a bit in the memory when the module is doing a soft reset, then when next time you start, you will know if this was a soft reset or not. So if it was not a software reset and you did not do a power cycle, then reset was done by watchdog, which will also the case when you have a kernel freeze.
Would it be implemented by queering the PMIC?
Yeah, exactly.
Thanks, Michael
You are welcome. Best regards
Hi @michaelg
You can find out if the reset of the module was done by watchdog by reading out 0xAh register from the PMIC by the following command in U-Boot:
Colibri iMX7 # i2c md 0x33 0xA 1
For decoding the response, please use the following picture:
Best regards,
Jaski