Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Querying if a task is alive in uCOS

Hi,

I want to implement a simple software watch dog task whose job is to see if all other tasked in the system are alive. If a task hangs (is dead) the watch dog would then remove power to an IO board in my system.

Is there any mechanism in uCOS that can be used to report the tasks health? i.e. detect if the task has hung (for whatever reason). I did look at the OSTaskQuery() function that populates an OS_TCB structure that has all sorts of interesting data within it, however didn't see anything specific that detemines if the task is still alive.

Much appreciated,

Aiden

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It would be easier to have each task that needs to be watched register with the watchdog task that you are creating. This way each task could be given a unique interval with each to signal the wdog task that they are alive.

    The OS would have difficulty saying whether a task is waiting too long for semaphore or in some unexpected infinite loop. This is an application specific problem.