cancel
Showing results for 
Search instead for 
Did you mean: 

issue with RTC Calendar alongside BLE on STM32WB

DPiór.1
Associate III

Hello,

I’m working on a project with the STM32WB55 where I use BLE (which is working fine) and also want to use the RTC Calendar. The project was generated with STM32CubeMX, RTC is using LSE.

The problem:

  • The RTC calendar runs, but its time counting is incorrect.

  • Instead of incrementing one minute (60 seconds), it only increments 4 seconds per minute.

What I tried:

  • In app_conf.h, in the section with RTC-related macros, I modified CFG_RTCCLK_DIVIDER_CONF to different values (16, 8), but the issue remains the same.
  • In main.cpp, during RTC initialisation:

hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER; 
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
I tried replacing these macros with explicit values (i.e. 127 and 255 which works on STM32L4), but the result did not change.

 

Has anyone experienced this before on STM32WB55? Any guidance or hints would be greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the info @STTwo-32 

Actually RTC Calendar is working good now :) I don't know why, I don't remember what I changed.

View solution in original post

2 REPLIES 2
STTwo-32
ST Employee

Hello @DPiór.1 

On the BLE context, Since the RTC is used for the HW timers. It may be some bad behaviors will using RTC Calendar modes. So, i may recomand you to use the Timer server utility for your application. Part 4.5 of the AN5289 Rev 18 may also help you.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for the info @STTwo-32 

Actually RTC Calendar is working good now :) I don't know why, I don't remember what I changed.