K64 watchdog intermittently resetting early

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

K64 watchdog intermittently resetting early

ソリューションへジャンプ
1,139件の閲覧回数
WilliamW
Contributor III

I am currently using the FSL to implement the watchdog timer on an MK64FX512VLQ12.  I am setting the timeout to 5 seconds.  I then use a test function that waits 10 seconds without refreshing the watchdog to cause it to trip.  Most of the time the watchdog trips at 5 seconds as expected but sometimes it trips at times between 2 and 4 seconds.  Could someone take a look at this and suggest what I might be doing wrong?

void Watchdog_Initialize( void )
{
	wdog_config_t config;
	WDOG_GetDefaultConfig( & config );

	// Enable Watchdog timer with a timeout of 5 seconds.
	config.timeoutValue = 5000;
	config.enableWdog = true;

	WDOG_Init( WDOG, & config );
}


void Watchdog_Reset( void )
{
	WDOG_Refresh( WDOG );
}


void Watchdog_Test( int nModulo )
{
	Watchdog_Reset();

	Command_Print( "Triggering watchdog timer reset by waiting for 10 seconds" );

	Timer_BeginCountdown( CountdownTimerMain, 10000 );

	while( ! Timer_IsCountdownExpired( CountdownTimerMain ) )
	{
		asm( "NOP" );
	}

	Command_Print( "Failed to trigger watchdog timer reset after 10 seconds" );
}
0 件の賞賛
返信
1 解決策
1,135件の閲覧回数
WilliamW
Contributor III

It looks like the problem was caused by the watchdog being refreshed too quickly in a different area of the code before the text took place.  I removed code from a wait loop that was essentially performing constant watchdog refreshes and the problem went away.  The problem may be related to the following: https://community.nxp.com/t5/Kinetis-Microcontrollers/MKV4x-Watchdog-refresh-problem/m-p/776179/high...

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,136件の閲覧回数
WilliamW
Contributor III

It looks like the problem was caused by the watchdog being refreshed too quickly in a different area of the code before the text took place.  I removed code from a wait loop that was essentially performing constant watchdog refreshes and the problem went away.  The problem may be related to the following: https://community.nxp.com/t5/Kinetis-Microcontrollers/MKV4x-Watchdog-refresh-problem/m-p/776179/high...

 

0 件の賞賛
返信