2026-02-25 6:05 AM
I have question on STM32WBA65RI uC we are using it for our products TEK923/926.
It seem to me that BLE stack doesn’t allow to use Free Running Binary mode and Calendar Mode.
There is option of MIX Mode in CubeMX but doesn’t seem working. Causing not to allow Alarm/Timer to configure and giving below error:
sAlarm->AlarmSubSecondMask
Details:1056964608
Default:1056964608
Decimal:1056964608
Hex:0x3f000000
ICSR
Details:519
Default:519
Decimal:519
Hex:0x207
RTC Config:
BLE Router Example code was used to modify above.
------------------------------------------------------------------------------------------------------------------------
I can see similar questions on ST Forum with no answer for STM32WBA65
https://community.st.com/t5/stm32-mcus-wireless/stm32wba65-ble-and-rtc-timer-not-firing/m-p/853213
----------------------------------------------------------------------------------------------------------------------
Ideally what we want is RTC with full date and time running with BLE using UTIL_TIMER drivers for others tasks.
Kind Regards,
Dhaval
Solved! Go to Solution.
2026-03-19 3:31 AM
Hi,
On STM32WBA, it is possible to use both the RTC calendar and the binary down-counter.
RTC should be configured in Mixed Mode.
Here is an example to use the BLE UTIL_Timer and the Calendar a the same time.
Then, separate the alarms:
This requires adapting MX_RTC_Init() and TIMER_IF_StartTimer() so that Alarm B is configured and used for calendar operations, while Alarm A remains fully masked (AlarmMask = RTC_ALARMMASK_ALL) for the timer server.
In mixed mode (calendar enabled), you must initialize a valid weekday for the alarm, otherwise the current assert in the RTC code will trigger.
If needed, I am attaching 2 files containing the changes with which we can achieve this.
BR, Joé
2026-03-10 6:06 AM
Bumping. I'm also curious about that assert and if anyone knows if its intended or if its an actual issue with the assert check itself. From my understanding, you should be allowed to use the entire sub-second register for alarms in mix mode as long as you mask all the calendar items? Maybe I'm incorrect, but i can't find anything about such a restriction in the RTC documentation. This assert should not trigger if you have masked all the calendar items?
2026-03-19 3:31 AM
Hi,
On STM32WBA, it is possible to use both the RTC calendar and the binary down-counter.
RTC should be configured in Mixed Mode.
Here is an example to use the BLE UTIL_Timer and the Calendar a the same time.
Then, separate the alarms:
This requires adapting MX_RTC_Init() and TIMER_IF_StartTimer() so that Alarm B is configured and used for calendar operations, while Alarm A remains fully masked (AlarmMask = RTC_ALARMMASK_ALL) for the timer server.
In mixed mode (calendar enabled), you must initialize a valid weekday for the alarm, otherwise the current assert in the RTC code will trigger.
If needed, I am attaching 2 files containing the changes with which we can achieve this.
BR, Joé