MK66FX - WDOG do not work

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

MK66FX - WDOG do not work

Jump to solution
1,289 Views
Anonymous
Deactivated User

Hi,

i have a board based on MK66FX1M0 uC , i have configured WDOG but when i try to reset the internal counter nothing seems to change, can someone help me?

 

My code : 

/**
* @file test_mk66fx.c
* @brief Application entry point.
*/
#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MK66F18.h"

/* TODO: insert other include files here. */
#include "fsl_gpio.h"
#include "fsl_wdog.h"

/* Define I/O PIN*/

#define BOOT_LED 28U // pin 28 of GPIOE - NOTE : InitBootPins() switch on the led


/* TODO: insert other definitions and declarations here. */
void setup(void);
void loop(void);

/*
* @brief Application entry point.
*/
int main(void) {
/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
//dopo la fase di setuo scheda spegne il led
GPIO_PinWrite(GPIOE,BOOT_LED,1); // switch off led - The led is switched on with InitBootPins()
setup();
WDOG_Refresh(WDOG_PERIPHERAL); // Reset The whatcdog
/* Enter an infinite loop*/
while(1) {
loop();
WDOG_Refresh(WDOG_PERIPHERAL);
}
return 0 ;
}

void setup(void){
}

void loop(void){

}

 
Peripherals configuration : 
 
WDOGCONFIG
 
0 Kudos
1 Solution
1,241 Views
nxf58904
NXP Employee
NXP Employee

Hi,

Please add the statement as follow shows,

while (GetTimerOutputValue(wdog_base) < (WDOG_config.timeoutValue >> 3U))
{
}

 

I have recur your issue and fix after add this statement.

 

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
5 Replies
1,242 Views
nxf58904
NXP Employee
NXP Employee

Hi,

Please add the statement as follow shows,

while (GetTimerOutputValue(wdog_base) < (WDOG_config.timeoutValue >> 3U))
{
}

 

I have recur your issue and fix after add this statement.

 

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
1,096 Views
ahmedhrabi
Contributor III

HI  @nxf58904

Have you any explications, why we have to wait (WDOG_config.timeoutValue >> 3U), which is about the the timeout value/8, to can refresh again the Wdog. This delay is too long (for a Wdg timeout of 500 ms per example we have a delay of 500 ms >> 3U = 62 ms to wait before refreshing again !!) . 

I noticed that in my project i have the same issue, if i refresh the wdg before the WDOG_config.timeoutValue >> 3U delay, the Wdog reset automatically the chip. 

Regards. 

 

0 Kudos
1,226 Views
Anonymous
Deactivated User

Hi,
I have try the code and now it work god.
My final code is :

 

void WDOG_RESET(){
WDOG_Refresh(WDOG_PERIPHERAL); // Reset The whatcdog
while (GetTimerOutputValue(WDOG_PERIPHERAL) < (WDOG_config.timeoutValue >> 3U))
{
}
}

static inline uint32_t GetTimerOutputValue(WDOG_Type *base)
{
return (uint32_t)((((uint32_t)base->TMROUTH) << 16U) | (base->TMROUTL));
}

0 Kudos
1,269 Views
Anonymous
Deactivated User

Yes when i try to refresh the watch dog counter it will continue to work and the onboard led will blink

0 Kudos
1,275 Views
nxf58904
NXP Employee
NXP Employee

Hi,

You mean nothing had changed when you reset the counter,what you mean is that you reset the counter but the cnt didn't reset?

When you refresh the counter , the watch dog will continue to work. Only when the watch dog was time out,it will reset the Mcu.

 

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos