AnsweredAssumed Answered

How to get task ID from MQX watchdog failure

Question asked by Rudy Vigneault on Jun 6, 2018
Latest reply on Jun 15, 2018 by Rudy Vigneault

Hi,

 

We are using the watchdog of MQX 4.2 to detect crashes or halted tasks but I would like to know what information is available when the watchdog error function is called.

 

We are creating the watchdog using

if(_watchdog_create_component(BSP_TIMER_INTERRUPT_VECTOR, handle_watchdog_expiry) != MQX_OK)
{
   printf("\nError creating watchdog component.");
   _task_block();
}

where handle_watchdog_expiry is defined as

void handle_watchdog_expiry(void* td_ptr)
{
   printf("Expired task 0x%P\n\r", td_ptr);

    // Trig the hardware WDT
    while(1);
}

The declaration follows the function pointer type definition

typedef void (_CODE_PTR_  WATCHDOG_ERROR_FPTR)(void *);

used in

extern _mqx_uint _watchdog_create_component(_mqx_uint, WATCHDOG_ERROR_FPTR);

 

When I print the parameter given as a void pointer, I cannot find anything into the code to match the task to.

 

Is it possible to cast the void pointer into some struct from which useful information could be obtained?

 

If not, how can I use the pointer to match to a task?

 

Thanks

Outcomes