I'm attempting to enable the WWDT timer on the LPC55S69. Unfortunately, my program hangs during a call to WWDT_Init. Any help would be appreciated and let me know if I can provide more information.
Below is the code I'm using to start the watchdog:
wwdt_config_t watchdog_config;
WWDT_GetDefaultConfig(&watchdog_config);
watchdog_config.timeoutValue = 0xFF * 2900;
watchdog_config.warningValue = 0xFF * 100;
WWDT_Init(WWDT, &watchdog_config);
The application hangs in WWDT_Init, specifically in this code that waits for the wwdt timer start:
if (config->enableWwdt)
{
while (base->TV == 0xFFUL)
{
}
}
I've printed out the values of the WWDT registers in the debugger while the program is stuck:
(gdb) p /x *((WWDT_Type *)0x5000C000u)
$2 = {MOD = 0x1, TC = 0xb48ac, FEED = 0x0, TV = 0xff, RESERVED_0 = {0x0, 0x0, 0x0, 0x0},
WARNINT = 0x39c, WINDOW = 0xffffff}
已解决! 转到解答。
Thanks for pointing me towards the example. I was able to successfully initialize the WWDT. The steps that I was missing were enabling the FRO 1M clock and setting the WWDT clock divider:
/* Enable FRO 1M clock for WWDT module. */
SYSCON->CLOCK_CTRL |= SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK;
/* Set clock divider for WWDT clock source. */
CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 1U, true);
Thanks for pointing me towards the example. I was able to successfully initialize the WWDT. The steps that I was missing were enabling the FRO 1M clock and setting the WWDT clock divider:
/* Enable FRO 1M clock for WWDT module. */
SYSCON->CLOCK_CTRL |= SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK;
/* Set clock divider for WWDT clock source. */
CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 1U, true);