cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Alarm and Stop Mode

jstuempfl9
Associate II
Posted on October 22, 2009 at 08:25

RTC Alarm and Stop Mode

4 REPLIES 4
tomas23
Associate II
Posted on May 17, 2011 at 13:23

Try to eanble access to the backup domain at the beginning of IRQ and disable at the end (or something similar), it helped...

judge
Associate
Posted on May 17, 2011 at 13:23

I am encountering the same problem attempting to wake from STOP mode using the RTC Alarm at 30 Hz. Sometimes it works for a little while, but will then hang as the original poster indicated.

Asserting/de-asserting the DBP bit in the PWR->CR register in the RTC Alarm ISR as suggested has not fix the problem.

[ This message was edited by: judge.maygarden on 25-09-2009 22:55 ]

jstuempfl9
Associate II
Posted on May 17, 2011 at 13:23

Hi @all,

I have a problem with the RTC Alarm Interrupt in combination with the Stop mode and do not come to a solution. Can please somebody help me here.

My application has to wake up in 60s intervals and check if it has to do something. The IWDG is active and set to the longest time which is about 17s. As a solution for that I set up an RTC Alarm IRQ which fires every 8s to reset the watchdog and increase a second counter by 8s (this all has not to be exact. For the exact time I use the RTC counter).

That all worked but suddenly very seldom the alarm irq does not fire anymore. So I started to test. Whats wrong with this example:

void RTCAlarm_IRQHandler(void)

{

u32 counter;

if(RTC_GetITStatus(RTC_IT_ALR) != RESET)

{

IWDG_ReloadCounter();

//PWR_BackupAccessCmd(ENABLE);

//RTC_WaitForSynchro();

RTC_WaitForLastTask();

RTC_ClearITPendingBit(RTC_IT_ALR);

/* Clear EXTI line17 pending bit */

EXTI_ClearITPendingBit(EXTI_Line17);

RTC_WaitForLastTask();

counter = RTC_GetCounter();

RTC_WaitForLastTask();

RTC_SetAlarm(counter + 8);

secCounter += 8;

if (secCounter >= 60)

{

...

...

secCounter = 0;

}

...

}

}

in main loop I tried - just for testing purposes this:

while(1)PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

As long as the stop mode is not executed the alarm irq works but as soon as the loop is reached the irq hangs in RTC_WaitForLastTask();

Is this method not allowed? Before I used this test the irq didn´t fire anymore at some time ago and not hang in RTC_WaitForLastTask() but with this test the irq hangs.

Can somebody please help getting to understand how to manage this?

Thanks,

Joachim

Posted on May 17, 2011 at 13:23

Hi All,

I have experienced the same problem. I have setup, RTC alarm interrupt thru EXTI17 to wakeup the CPU from LP stop mode.

It appears the irq, very rarely, does not fire. I am still trying to figure out why. I wanted to ask if you have been able to resolve this issue.

Regards,

Kerem