Reset Colibri iMX7 from M4 core

Hello,

We are developing an application using Colibri iMX7 and we intend to prevent the system to get stuck at u-boot if the Linux image don’t boot up.

How can we detect a boot failure? So, the bootloader can take some action to recover the faulty image?

Thanks,

Luan

Could you explain - what kind of problem you are going to solve? Corruption of file system?
During a boot Boot loader is looking for files with Device Tree and Linux kernel. If one of that file missed than U-Boot can recognize an issue. If files a present U-Boot loaded both to memory and pass a control to kernel. Either kernel or RootFS could be corrupted and boot will fail but U-Boot can not recognize that issue.

You can use some kind of Watch Dog timer to detect a boot failure at m4 level, but what kind of action you are going to take in case of failure?

The biggest problem we may have is a corrupted file system. Sometimes, we get stuck in the “Starting kernel …” prompt.

A watchdog in M4 would be great!

We will have a “double copy system”, so, if the boot fails, we can boot using the previous image.

Hope you had understood me.

Best regards,
Luan

hi

I think, the best would be to create a counter in uboot and count up every time you boot up and resetting the counter, once you are in Linux. If the counter exceeds a limit, then you can flash/switch to a different image.

For resetting the system, during a kernel panic the PIMIC watchdog can be used.

Hello,

I already done the double copy system, but I’m not able to make watchdog works.

I’m booting using TFTPBoot, so, in U-Boot, I used:

Colibri iMX7 # setenv bootargs noinitrd console=ttymxc0,115200 rn5t618-wdt.timeout=8
Colibri iMX7 # setenv autoload 0 && dhcp && setenv serverip 192.168.0.226 && tftp ${fdt_addr_r} mobitec_iris_imx7_l.dtb && tftp ${kernel_addr_r} uImage_l && bootm ${kernel_addr_r} - ${fdt_addr_r}

The system boots up without any problem, but the watchdog does not reboot it.
I had tried using the “nowayout” parameter, but without success.

Any idea why I can not make watchdog work?

Could you provide the version of the hardware and software (cat /etc/issue) of your module?
Thanks

I’m creating my own system using buildroot.

I’m using Toradex’s Kernel and U-Boot:
Kernel version: 1db9f06709adfa8fbf538ebc0c17b0b29cf693c6
U-Boot: 2016.11-toradex

My M4 application is based in Toradex’s FreeRTOS examples.

Thank you very much!

Hello
Thanks for the Information. I am doing tests on my side to check why the watchdog is not resetting. At meantime, you can check this community post, which explains how the resetting of kernel can be implemented in case of kernel panic.

Hello,

Sorry for the long delay.

I was not able to make the watchdog work using the link shared. I forced a Kernel error and the system got stuck.

Any idea why?

Best regards,
Luan

Can you share what exact changes you made and how you forced the kernel error?