Faced a problem when the program goes into interrupting the watchdog.
How can I find out the trigger source of a watchdog? Program address where the program hung and the watchdog worked?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Faced a problem when the program goes into interrupting the watchdog.
How can I find out the trigger source of a watchdog? Program address where the program hung and the watchdog worked?
Hi Igor,
I am assuming your WDT has raised an interrupt. This means that the Watchdog_clear(watchdogHandle) was not called by your application.
So if you have multiple tasks, maybe one of them is running infinitely not allowing the task which is responsible of calling Watchdog_clear not to execute.
The Watchdog module itself would not be able to provide the PC where the program is hung. But you can use the Run time object view in CCS to figure out the task states to check which task was preempted.
Please check our debugging guide to check the use of ROV.
Regards,
Sid
I found one way to get the hangup address after which the WDT handler was called. How do you think it is correct?
In register R13 (SP) at offset 8, I always get the value of the hangup address.
PS: there is only one task in my program.
volatile uint32_t wdtFaultAddress;
/*
* ======== watchdogCallback ========
*/
void watchdogCallback(uintptr_t watchdogHandle)
{
uint32_t *stack_pointer = (uint32_t *)__get_MSP();
wdtFaultAddress = *(stack_pointer+8);
while (1) {}
}
Hi Igor,
I am not exactly sure what you are reading out. How are you verifying that it was the program Counter where the program hung?
Please refer to the Exception entry and return section in the technical reference manual.
This section has the description of what is saved when entering the handlers.
Regards,
Sid