Skip to main content
LTing
Associate II
December 12, 2019
Question

How to add a watchdog?

  • December 12, 2019
  • 3 replies
  • 970 views

My touchgfx task is often frozen. I need to add a watchdog to the touchgfx task. When the task is frozen, the system can restart automatically.

How to add a watchdog in Touchgfx task?

​Thanks.

This topic has been closed for replies.

3 replies

Ozone
Principal
December 12, 2019

The watchdog will not resolve your problem.

It is supposed as a measure of last resort. I would try to find the causal bug first.

The "freeze" - and it's causes - depend on your target and application. You can try to start the investigation from the fault handler side, like investigating the SCB register values if we speak about a Cortex M.

The "watchdog" depends on your target as well. Check the datasheet / reference manual.

HP_it
Senior II
December 12, 2019

@Ozone​ is right - the watchdog is a last resort if you can't fail gracefully. However, I would implement the watchdog in a separate task so you don't have to edit the graphics task. the only purpose that task will have is to reset the timer.

JimFouch
Associate III
December 12, 2019

If the error/lockup is in your GUI code, I'd try running in Visual Studio as simulator and put brake points in near the area of the lockup and walk through the code to find the issue.

It's one of the most powerful features of how they have ToughGFX setup.