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.

TMS570LC4357: After reset on a watchdog time out the application code does not run

Part Number: TMS570LC4357


Tool/software:

Hi,

I have read the post titled: TMS570LC4357: WDT handling - upon watchdog reset

I am using the watchdog in the following way:

void startWatchDog(void)
{
    /*watch dog*/
    dwdInit(WDOG_REG, WDOG_TIMEOUT); //set pre scaler and timer to use
    dwdCounterEnable(WDOG_REG); //turn on
}

/*************************************************************************************
 * Function name   : petWatchdog()
 * Description     : reset the watch dog
 *
 * @return - nothing
 ***************************************************************************************/
void petWatchDog(void)
{
    dwdReset(WDOG_REG); //reset watchdog
}


After the watchdog times out and the MCU resets the application does not recover and nothing appears to happen, even after adding the bit below from reading the referenced post.

A couple of questions:
1.In the documentation after a watchdog timeout it talks about two options, a reset occurring or a Non Maskable Interrupt occurring, how is this configured for the non-windowed watchdog or is the only choice a reset?

2. In the documentation specifically the 'System Exception Status Register' it states the flag for the a watchdog reset is at bit 13, in the example in the referenced post it uses the bit which in the docs says bit 12 is not used...

From your example I have added the following the HL_sys_startup.c

case WATCHDOG_RESET:
case WATCHDOG2_RESET:

	/* USER CODE BEGIN (15) */
	_memInit_();
	if (_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)
	{
		/* Put system in a safe state */
		handlePLLLockFail();
	}
	_coreEnableEventBusExport_();
	systemInit();
	_coreEnableIrqVicOffset_();
	vimInit();
	esmInit();
	/* USER CODE END */
	break;

Why is the case statement WATCHDOG_RESET not used, what is it there for in the case statement?

Thanks