cancel
Showing results for 
Search instead for 
Did you mean: 

RTC not running in Stop Mode

Posted on August 05, 2014 at 14:58

Using an STM32F103, I want to wake from Stop mode by RTC alarm after 5 seconds.

I have set EXTI on UART_RX and #17 for RTC.

Here is what I know:

  • I can put the MCU into Stop mode (via WFI).
  • I can wake from Stop via UART_RX EXTI.
  • I can configure RTC for LSI, and it counts up in Run mode.
  • I see 5sec RTC alarm triggers EXTI_17 in Run mode.

However, when MCU is in Stop mode, it appears that the RTC counter doesn't advance at all. After Stop for 10sec, the RTC time is only 1sec later than when we entered Stop mode.

It seems I'm missing something like ''Enable RTC clock in Stop Mode''.

Can anyone give me a tip?

Best,

 Chris
2 REPLIES 2
Posted on August 05, 2014 at 16:15

It seems I'm missing something like...

Like the LSI is in the wrong power domain, use the LSE

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 05, 2014 at 16:16

I solved my issue by resetting the backup domain in my initialization code:

298   PWR->CR |= PWR_CR_DBP;

299   RCC->BDCR |= RCC_BDCR_BDRST;

300   RCC->BDCR &= ~(RCC_BDCR_BDRST);

And then wakeup from RTC works as expected.