I have set up a Linux system using Yocto on a Zynq-7000 with Petalinux 2021.1. My current task involves resetting a hardware watchdog every 2 seconds. Resetting the watchdog once my system is already up and running is not an issue. However, I am facing a challenge in resetting the watchdog during the boot process.
My understanding is that the u-boot phase takes less than 2 seconds, so resetting the watchdog at that moment is unnecessary. However, there is a significant gap of approximately 40 seconds between the kernel launch and the user connection.
Does anyone have any ideas or suggestions on how to tackle this issue?
I tried to launch a service at beginning of Kernel but without success.
Your assistance would be greatly appreciated!
Boune.
Sounds like a job for a kernel module. Check if one of these modules is something that you are looking for:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842055/Cadence+WDT+Driver
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841776/Axi+Watchdog
If not, you can write a small kernel module and put it into the
initrd
/initramfs
so it will be loaded on start.https://docs.xilinx.com/r/2021.2-English/ug1144-petalinux-tools-reference-guide/Creating-and-Adding-Custom-Kernel-Modules
initramfs
also supports running some shell scripts on the start but I'm not sure how it works on Petalinux.If the time is still too late you could build the kernel with the module included (as built-in). There is a mechanism named
initcall
which controls the order of the built-in modules' initialization. https://0xax.gitbooks.io/linux-insides/content/Concepts/linux-cpu-3.html