MK66FX - WDOG do not work

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MK66FX - WDOG do not work

ソリューションへジャンプ
2,599件の閲覧回数
Anonymous
適用対象外

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 件の賞賛
返信
1 解決策
2,551件の閲覧回数
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 件の賞賛
返信
5 返答(返信)
2,552件の閲覧回数
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 件の賞賛
返信
2,406件の閲覧回数
ahmedhrabi
Contributor IV

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 件の賞賛
返信
2,536件の閲覧回数
Anonymous
適用対象外

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 件の賞賛
返信
2,579件の閲覧回数
Anonymous
適用対象外

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

0 件の賞賛
返信
2,585件の閲覧回数
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 件の賞賛
返信