WWDT1 problem on RT685

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

WWDT1 problem on RT685

494 Views
scott-kooy
Contributor III

I am trying to implement the WWDT1 on RT685.  I was successful implementing the WWDT0, and I initialized the WWDT1 the exact same way:

 

const wwdt_config_t WWDT0_config = {
.enableWwdt = true,
.enableWatchdogReset = true,
.enableWatchdogProtect = false,
.enableLockOscillator = false,
.windowValue = WWDT0_WINDOW,
.timeoutValue = WWDT0_TIMEOUT,
.warningValue = WWDT0_WARNING,
.clockFreq_Hz = 1500
};

static void WWDT0_init(void) {
/* WWDT0 initiation */
WWDT_Init(WWDT0_PERIPHERAL, &WWDT0_config);
/* Enable interrupt WDT0_IRQn request in the NVIC. */
EnableIRQ(WWDT0_IRQN);
}

/***********************************************************************************************************************
* WWDT1 initialization code

/* clang-format on */
const wwdt_config_t WWDT1_config = {
.enableWwdt = true,
.enableWatchdogReset = true,
.enableWatchdogProtect = false,
.enableLockOscillator = false,
.windowValue = WWDT1_WINDOW,
.timeoutValue = WWDT1_TIMEOUT,
.warningValue = WWDT1_WARNING,
.clockFreq_Hz = 1500
};

static void WWDT1_init(void) {
/* WWDT1 initiation */
WWDT_Init(WWDT1_PERIPHERAL, &WWDT1_config);
/* Enable interrupt WDT1_IRQn request in the NVIC. */
EnableIRQ(WWDT1_IRQN);
}

/***********************************************************************************************************************
* Initialization functions
**********************************************************************************************************************/
void BOARD_InitPeripherals(void)
{
/* Initialize components */
//WWDT0_init();
WWDT1_init();
}

 

On the Hifi4 I have this code:

//Watchdog Timer defines
#define WWDT1_FEED_ADDR (0x4002E008)
#define WWDT1_TV_ADDR (0x4002E00C)
#define WWDT1_FEED_VAL_1 (0xAAU)
#define WWDT1_FEED_VAL_2 (0x55U)
#define WWDT1_WINDOW (1048576UL) 

 

In the idle loop is this code:

if (g_bBlinkBlueLEDForBoardAlive)
{
nCount = (nCount + 1) % 10000;

if (nCount == 0)
{
if ( *((uint32_t *)WWDT1_TV_ADDR) < WWDT1_WINDOW )
{
*((uint32_t *)WWDT1_FEED_ADDR) = WWDT1_FEED_VAL_1;
*((uint32_t *)WWDT1_FEED_ADDR) = WWDT1_FEED_VAL_2;
LED_BLUE_TOGGLE();

}


}
}

 

When the feed value is written to the feed register, the Hifi4 resets.  Why?  The WWDT1 registers are not accessed anywhere else in the code, so I do not understand why the Hifi4 core is resetting.

 

Thanks.

 

 

0 Kudos
1 Reply

483 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

I ported the CM33 WDT0 example on DSP. It works fine. Please see the attachment. It is base on the hello_world_usart_hifi4 example.

 

Regards,

Jing

0 Kudos