K60 Watchdog reset problem using LPO as clock source

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

K60 Watchdog reset problem using LPO as clock source

144 Views
rlEmbi
Contributor I

Hi,

We have a board with the K60 processor where we initiate the Watchdog to have one second timeout, and using the LPO Clock Source.

const wdog_config_t config = {
.clockSource = kWDOG_LpoClockSource,
.prescaler = kWDOG_ClockPrescalerDivide1,
.timeoutValue = 1000UL, // 1 sec WD timeout
.enableWindowMode = false,
.windowValue = 0UL,
.enableUpdate = true,
.enableWdog = true,
.workMode = {
.enableWait = true,
.enableStop = false,
.enableDebug = false},
.enableInterrupt = false
};
WDOG_Init(WDOG, &config);

 

Then we use the NXP function, WDOG_Refresh(WDOG), to reset the watchdog within the timeout.
This doesn't work, the controller enters reset.
 
If we change the clock source to kWDOG_AlternateClockSource, and update the .timeout Value to 48000000UL, to achieve one second timeout, it works.

Is there any thing we are missing for the LPO Clock Source mode?
Thanks in advance!
 
Code:
void WDOG_Refresh(WDOG_Type *base)
{
    uint32_t primaskValue = 0U;

    /* Disable the global interrupt to protect refresh sequence */
    primaskValue  = DisableGlobalIRQ();
    base->REFRESH = WDOG_FIRST_WORD_OF_REFRESH;
    base->REFRESH = WDOG_SECOND_WORD_OF_REFRESH;
    EnableGlobalIRQ(primaskValue);
}
#define WDOG_FIRST_WORD_OF_REFRESH  (0xA602U) /*!< First word of refresh sequence */
#define WDOG_SECOND_WORD_OF_REFRESH (0xB480U) /*!< Second word of refresh sequence */
 
 

Then we use the 

Best Regards,
Rolf Lien

0 Kudos
Reply
1 Reply

118 Views
XuZhang
NXP Employee
NXP Employee

hi,rlEmbi

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.

The twrk60d100m_driver_examples_wdog demo in SDK 2.2.0 describes Watchdog operations.In the demo, the LPO clock 1Khz was used without frequency division, as shown in the figure below.

XuZhang_0-1725528990146.png

I did some tests, using WDOG_Refresh(wdog_base), and then set timeoutValue to 3FF, found that it worked, there was no reset in timeout, I put the code in the attachment, hoping to help you.

XuZhang_1-1725529023970.png

Wish it helps you.

If you still have question about it,please kindly let me know.

BR

Xu Zhang

0 Kudos
Reply