cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Alarm Register Corruption

Aaron McNeil
Associate III

We have been using an STM32L476 in a product that schedules periodic wake times. Recently we have discovered a bug where the unit will go to sleep and never wake back up. What we have noticed is after generating another interrupt to wake the unit up and inspecting the RTC Alarm B register we are using, the HT register has been corrupted or written to inadvertently to a value that doesn't make sense.

For example, one unit was scheduled to wake up at 00:40 (HH:MM) but the register showed 30:40. In the second example, the unit was scheduled to wake up at 08:32 but the alarm showed 38:32. Its like the HT register is getting a 3 put in it occasionally and causing the time to never match programmed time.

I also noticed the PM register is getting set to 1 in these problem units but my code never writes to that parameter. Is there any known issues that I should be aware of that could cause a corruption like this in the RTC alarm?

1 ACCEPTED SOLUTION

Accepted Solutions

> Is there any known issues

Let me guess: you are using Cube/HAL. Look for improperly initialized "initialization struct".

JW

[EDIT] https://community.st.com/s/question/0D50X0000BWnYKDSQ3/why-an-stm32l476s-rtc-counts-more-than-24h-and-dont-icnreases-the-day

View solution in original post

2 REPLIES 2

> Is there any known issues

Let me guess: you are using Cube/HAL. Look for improperly initialized "initialization struct".

JW

[EDIT] https://community.st.com/s/question/0D50X0000BWnYKDSQ3/why-an-stm32l476s-rtc-counts-more-than-24h-and-dont-icnreases-the-day

Aaron McNeil
Associate III

Bingo. I think this is my problem. Thank you!