0

I am working on an STM32 project where I need to manage two RTC alarms: Alarm A for periodic wake-ups and Alarm B for switching modes after a specific timeout. The system enters standby mode and wakes up multiple times before Alarm B's timeout. I am encountering an issue where Alarm B does not trigger as expected after the timeout.

Both alarms work individually, but Alarm B fails to trigger when both alarms are used together, especially after waking-up from standby mode.

Question:

I understand that when waking up from standby mode, the MCU typically performs a restart. Could this be causing Alarm B not to trigger after the wake-up?

Is there a way to make this approach work reliably, where Alarm B triggers even after multiple wake-ups from standby mode?

3
  • Are the alarms synchronised? Could alarm B happen at the exact same time as alarm A? Do you check for this, or just realise that alarm A has happened and skip checking alarm B? e.g. alarm A happens every 10 minutes, and alarm B happens every 60 minutes. After 60 minutes, they both happen at the same time. Commented Nov 12, 2024 at 0:21
  • Hi @pmacfarlane thanks for answering. No, they are not synchronized. The device follows a cycle where it sleeps for 15 seconds, wakes up for 5 seconds, and then returns to sleep. I have experimented with various values for setting Alarm B and observed the following: If I set the alarm to trigger after 10, 17, 20 seconds, it works as expected. However, it seems that the alarm functions correctly only within the first cycle (up to around 20 seconds). Beyond this, it doesn’t work as expected. Commented Nov 12, 2024 at 9:37
  • In other words, I assume that I am losing Alarm B because the device performs a reset when waking up from standby mode. If this is the case, is there a way to prevent this while still using standby mode? Commented Nov 12, 2024 at 10:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.