Skip to main content
Visitor II
December 24, 2024
Question

Issue with STM32F407G-DISC1 Sleep Mode and RTC Wake-up After 3 Minutes

  • December 24, 2024
  • 1 reply
  • 597 views

Hello STM32 Community,

I am using the STM32F407G-DISC1 development board and have successfully implemented an RTC alarm that triggers every minute. The RTC is configured to use the LSI (Low-Speed Internal) clock signal.

My goal is to have the microcontroller enter sleep mode and wake up after 3 minutes using the RTC wake-up feature. However, when the MCU enters sleep mode, it wakes up prematurely, within only 2 seconds, instead of the expected 3-minute wake-up period.

I would appreciate any assistance or insights into resolving this issue. Has anyone encountered a similar problem when using the LSI clock for RTC wake-up, or can you suggest any potential causes for this behavior?

Thank you in advance for your help!ioc configurationioc configurationRTC init_1RTC init_1RTC init_2RTC init_2Stop functionStop functionwake up functionwake up function

    This topic has been closed for replies.

    1 reply

    Super User
    December 24, 2024

    Procedure for waking up in the future:

    • Get the current time.
    • Change the time to 3 minutes in the future and set the alarm to wake up then.
    • Since you want to wake up when minutes and seconds match, mask everything except minutes and seconds. Your current mask ignores minutes.

    Your current code wakes up when seconds = 1 and ignores minutes.