Hi everyone,
In the past I've reported a problem on using watchdog (see WDOG unlock causes reset). The problem was bypassed, but now i'ts come back on a new project.
I explain it again: I use a custom board based on K66, MCUXpresso 11.0.0, SDK 2.6 and FreeRTOS 10.2.0.
If I call the WDOG_Init() function after the os starts (at the beginning of the first task), the controller resets when it executes the WDOG_Unlock() function.
If I call the WDOG_Init() function before the os starts, this function is executed with no error, but the controller
resets when it executes the WDOG_Refresh() function, called by the first task.
/******************************************************/
void main( void )
{
...
xTaskCreate( ... ); //create first task
vTaskStartScheduler();
}
void FirstTask( void * )
{
InitWDOG(); //init wdog <<<<<<<<<<<<<<<< CONTROLLER RESETS
...
}
/******************************************************/
/******************************************************/
void main( void )
{
...
xTaskCreate( ... ); //create first task
InitWDOG(); //init wdog <<<<<<<<<<<<<<<< INSTRUCTION EXECUTED
vTaskStartScheduler();
}
void FirstTask( void * )
{
...
WDOG_Refresh(); //refresh wdog <<<<<<<<<<<<<<<< CONTROLLER RESETS
...
}
/******************************************************/
What can I check?
Many thanks
Biafra