RTWDOG suspends all tasks upon failed refresh, does not reset MCU as expected

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTWDOG suspends all tasks upon failed refresh, does not reset MCU as expected

539 Views
ikuzmych
Contributor II

As I am debugging my RTWDOG timer on an RT1020 I am running into an issue. Whenever I run my tasks as I expect and refresh my RTWDOG, they work fine. However, if I forcefully try to have the RTWDOG fail and reset my MCU, it fails and gives me this error message:

ikuzmych_0-1670011227923.png

I am debugging using "Debug using LinkServer probes" and flashing the code to my RT1020 board, and I initialize the RTWDOG in my main() function after the Board config functions and before I create my freeRTOS tasks.

This is my current RTWDOG configuration, where I set debug and the other debug configurations to false, as I am flashing to my board:

uint16_t temp;
/* When system is boot up, WDOG32 is disabled. We must wait for at least 2.5
* periods of wdog32 clock to reconfigure wodg32. So Delay a while to wait for
* the previous configuration taking effect. */
/* DELAY_TIME = 0x140 ~ 2.5 seconds */
for (temp = 0; temp < DELAY_TIME; temp++)
{
__NOP(); // NOP = no operation
}
/**
* config->enableRtwdog = true;
* config->clockSource = kRTWDOG_ClockSource1;
* config->prescaler = kRTWDOG_ClockPrescalerDivide1;
* config->workMode.enableWait = true;
* config->workMode.enableStop = false;
* config->workMode.enableDebug = false;
* config->testMode = kRTWDOG_TestModeDisabled;
* config->enableUpdate = true;
* config->enableInterrupt = false;
* config->enableWindowMode = false;
* config->windowValue = 0U;
* config->timeoutValue = 0xFFFFU;
*/
/* get the default configuration for the rtwdog as listed above */
RTWDOG_GetDefaultConfig(&config); // get the default configuration of rtwdog

/*
* Change the timeout value to 3 secs.
* Use the prescaler to divide the 32.768 kHz clock by 256
* turn off wait and stop, and enable debug to run the debugger.
* When flashing to the board debug must be flagged false
*/
config.timeoutValue = 0x0180U; // set the timeout value to 3 secs for prescaled 32kHz clock1
config.prescaler = kRTWDOG_ClockPrescalerDivide256; // prescaler to increase the timeout value ((32.768 * 10^3) / 256)
config.workMode.enableWait = false;
config.workMode.enableDebug = false;
config.workMode.enableStop = false;
config.enableUpdate = true;
config.enableInterrupt = true;

/* initialize the rtwdog timer.
* To be called in main()
*/
RTWDOG_Init(RTWDOG, &config);

What can I change to have my RTWDOG reset my MCU automatically and not give me the thread suspension issue? I based my implementation on the rtwdog example provided by the SDK, and after I ran that I got the same thread suspension. Is it an issue with how I am debugging or something in the code is configured incorrectly?

Labels (1)
Tags (2)
0 Kudos
Reply
1 Reply

518 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @ikuzmych,

You mention that the example code also results in thread suspension, and loosing of the debug session. This means that you don't see the example messages on your terminal window? If you look into the example project, under "doc" you can find a read me with three Note sections. Please look into these notes and make sure you are following them correctly.

 

BR,

Edwin.

0 Kudos
Reply