cancel
Showing results for 
Search instead for 
Did you mean: 

Watchdog with clock source = rtc causes

spigeon
Associate II
Posted on March 23, 2008 at 17:19

Watchdog with clock source = rtc causes

2 REPLIES 2
spigeon
Associate II
Posted on May 17, 2011 at 09:50

The code below causes my STR912FAW44X6 to crash (JTAG not responding) and the next upload fails with ''unable to halt ARM core''...

The crash occurs during the write to WDG->CR in WDG_TimerModeCmd(ENABLE);

Crash does NOT occur if I use ClockSource_Apb.

Any ideas ?

Steph

void main ( void )

{

WDG_InitTypeDef WDG_InitStructure;

SCU_MCLKSourceConfig(SCU_MCLK_OSC);

SCU_APBPeriphClockConfig(__RTC,ENABLE);

SCU_APBPeriphReset(__RTC,DISABLE);

// uSec = ((Prescaler+1) * Preload * Tclk)/1000

// Using 32kHz RTC clock, (10 * 31250 * 32000)/1000 = 10000000 us

SCU_APBPeriphClockConfig(__WDG, ENABLE);

WDG_DeInit();

WDG_InitStructure.WDG_Preload = 31250;

WDG_InitStructure.WDG_Prescaler = 10;

WDG_InitStructure.WDG_ClockSource=WDG_ClockSource_Rtc;

WDG_Init(&WDG_InitStructure);

WDG_TimerModeCmd(ENABLE);

}

mark9
Associate II
Posted on May 17, 2011 at 09:50

I'm having a similar problem. It seems occasionally, when I call WDG_TimerModeCmd(ENABLE) within 100 microseconds after reading from the GPIOs and/or the ADCs, the processor hangs within a few milliseconds after that. I can't be any more precise than that, since it is very tricky to debug watchdog failures -- I can't use JTAG!

I would be interested if this is a new errata or if there is any news on this.