2022-04-22 2:55 AM
I managed to make the M4 WWDOG to work.
I got on Linux cmd line:
remoteproc remoteproc0: crash detected in m4: type watchdogHow can I catch and handle this events programmatically on a shell script, C or Python ?
Solved! Go to Solution.
2022-04-29 8:13 AM
Hello Mario,
Different strategies are possible.
1) The polling method
echo disabled >/sys/class/remoteproc/remoteproc0/recoverycat /sys/class/remoteproc/remoteproc0/stateecho recover >/sys/class/remoteproc/remoteproc0/recovery 2) Use coredump trigger
An event is sent to the userspace application on crash to save the coredump, this can also be used to detect the crash
Details and link to udev script are available on this page:
https://wiki.st.com/stm32mpu/wiki/How_to_retrieve_Cortex-M4_logs_after_crash
3) Create your own udev trigger based on virtio device add/remove ( work only if you use RPMsg)
this page provide details on how to implement it:
https://www.tecmint.com/udev-for-device-detection-management-in-linux/
The rules to implement is:
SUBSYSTEM=="virtio", ACTION=="add",   RUN+="/bin/device_added.sh"
SUBSYSTEM=="virtio", ACTION=="remove", RUN+="/bin/device_removed.sh"4) tips to ease your test
you can simulate a watchdog crash using following command:
echo 1 >/sys/kernel/debug/remoteproc/remoteproc0/crashRegards,
Arnaud
2022-04-29 8:13 AM
Hello Mario,
Different strategies are possible.
1) The polling method
echo disabled >/sys/class/remoteproc/remoteproc0/recoverycat /sys/class/remoteproc/remoteproc0/stateecho recover >/sys/class/remoteproc/remoteproc0/recovery 2) Use coredump trigger
An event is sent to the userspace application on crash to save the coredump, this can also be used to detect the crash
Details and link to udev script are available on this page:
https://wiki.st.com/stm32mpu/wiki/How_to_retrieve_Cortex-M4_logs_after_crash
3) Create your own udev trigger based on virtio device add/remove ( work only if you use RPMsg)
this page provide details on how to implement it:
https://www.tecmint.com/udev-for-device-detection-management-in-linux/
The rules to implement is:
SUBSYSTEM=="virtio", ACTION=="add",   RUN+="/bin/device_added.sh"
SUBSYSTEM=="virtio", ACTION=="remove", RUN+="/bin/device_removed.sh"4) tips to ease your test
you can simulate a watchdog crash using following command:
echo 1 >/sys/kernel/debug/remoteproc/remoteproc0/crashRegards,
Arnaud
