watch dog disable

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

watch dog disable

673 次查看
vladimirchernin
Contributor III

hi!

i am setting up wdog  like this
 
    /* Enable RTWDOG clock */
  RTWDOG_GetDefaultConfig(&config);
config.testMode        = kRTWDOG_UserModeEnabled;
config.enableInterrupt = false;
config.prescaler    = kRTWDOG_ClockPrescalerDivide256;
config.timeoutValue = 5*32000/256;
config.enableUpdate = true;
RTWDOG_Init(EXAMPLE_WDOG_BASE, &config);
CLOCK_EnableClock(kCLOCK_Wdog3);
NVIC_EnableIRQ(RTWDOG3_IRQn);

and i want to disable it by using  RTWDOG_Deinit(EXAMPLE_WDOG_BASE);

i put enableUpdate = true because i want option to stop or change timeout it but i cannot stop it or change it

what is wrong here ? 

i run code on rt1176  

thanks

 

标记 (2)
0 项奖励
回复
2 回复数

654 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @vladimirchernin

As mentioned in section 79.5.1 Disable Watchdog of the Reference Manual, "To disable the watchdog, first do unlock sequence, then unset the WDOG_CS[EN] bit."

That said, as stated on section 79.3.2.2.1 Unlocking the Watchdog, to unlock the WDOG you must write the unlock sequence to the CNT register within 31 bus clocks at any time after the watchdog has been configured. On completing the unlock sequence, the user must reconfigure the watchdog within 255 bus clocks; otherwise, the watchdog closes the unlock window.

Please make sure these bus clock requirements are also taken into account.

Finally, take not that disabling the watchdog is different if done after a reset. The proper disabling of this module after a reset is described on section 79.5.2 Disable Watchdog after Reset.

 

BR,
Edwin.

 

 

0 项奖励
回复

649 次查看
vladimirchernin
Contributor III

HI!

I use nxp driver functions and its not working i am at rt1176 board 


/*!
* brief De-initializes the RTWDOG module.
*
* This function shuts down the RTWDOG.
* Ensure that the WDOG_CS.UPDATE is 1, which means that the register update is enabled.
*
* param base RTWDOG peripheral base address.
*/
void RTWDOG_Deinit(RTWDOG_Type *base)
{
uint32_t primaskValue = 0U;

/* Disable the global interrupts */
primaskValue = DisableGlobalIRQ();
RTWDOG_Unlock(base);
RTWDOG_Disable(base);
EnableGlobalIRQ(primaskValue);
}

  

0 项奖励
回复