Hi
If you have code that may take a long time and causes a SW WDOG timeout (but not due to an error, as such) you can increase the watchdog value in (for example the i.MX RT project)
#define ACTIVATE_WATCHDOG() UNLOCK_WDOG3(); WDOG3_TOVAL = (2 * 32000); WDOG3_WIN = 0; WDOG3_CS = (WDOG_CS_CLK_LPO | WDOG_CS_FLG | WDOG_CS_CMD32EN | WDOG_CS_EN); // enable watchdog with 2s timeout (32kHz reference)
or add re-triggers in the code [fnRetriggerWatchdog()].
To identify the location you can add a HW timer (single-shot that can be re-triggered) configured to a slightly lower timeout than the watchdog timeout.
Add a re-trigger of it to the macro
TOGGLE_WATCHDOG_LED()
and set a break point in its interrupt handler.
If this interrupt fires you can look to see which code is executing (step out of the interrupt or look at the call stack).
Regards
Mark