cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 RTC ARALM with subsecond match stalls if the next alarm is one tick away

Thomas Roell
Associate III
Posted on October 12, 2017 at 17:10

Ok, quick background first. I am using RTC ALARMB to have a timeout queue that survives STOP mode (which SYSTICK does not).

My PREDIV_S is 2048, PREDIV_A is 16 in case this matters.

The code that I am using can run into the situation that RTC->ALRMBSSR == RTC->SSR - 1 (plus of course the match mask,  remember that SSR counts down, so this means that the alarm is one tick away). I made sure that after setting ALRBE / ALRBIE the RTC->SSR value did not toggle (i.e enable after the event should occur). BYPSHAD is set to avoid the shadow copy registers, so it's not a case where 'RTC->SSR' is about to be updated.

Tried disabling ALRBIE and waited manually for ALRBF. So none of the obscure concurrency issues. It just really sits there and ALRBF stay reset.

The effect has a 100% repro rate in STM32L072.

Didn't see any errata, or documentation that would single out this case.

0 REPLIES 0