cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB how to use RTC with BLE

PADAM.1
Associate III

Hello,

When activating STM32_WPAN in STM32CubeIDE for STM32WB, the prescaler of RTC is forced to CFG_RTC_ASYNCH_PRESCALER (value is 15) and CFG_RTC_SYNCH_PRESCALER ( value is 0x7FFF ).

I am used to configure RTC on other STM32 products with 127 and 255 values.

During test, I see that the RTC is running ~ 16 times to slow.

Do I miss something?

Is this problem similar to point 2 of the question "STM32WB - Problems with BLE and RTC" from "MLind.2" on 2020∕05∕25?

Thanks for help

Best regards

Paul

3 REPLIES 3
PADAM.1
Associate III

Additional questions to the problem:

Why is the prescaler of RTC forced to only the defines?

In source code generated from STM32CubeIDE, (file app_conf.h line 333) I can read:

#define CFG_RTCCLK_DIVIDER_CONF 0
 
#if (CFG_RTCCLK_DIVIDER_CONF == 0)
/**
 * Custom configuration
 * It does not support 1Hz calendar
 * It divides the RTC CLK by 16
 */
#define CFG_RTCCLK_DIV  (16)
#define CFG_RTC_WUCKSEL_DIVIDER (0)
#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
 
#else

To use RTC together with STM32_WPAN (I hope that these are usable together), should I modify app_conf.h?

Wouldn't it be better to be generated by STMCubeIDE?

How to do?

mnoro.1
Associate III

change #define CFG_RTCCLK_DIVIDER_CONF 0 to 16

Hi, I have the same issue,

Wish to run BLE with RTC and calendar to keep track of the time and keep the low power.

when i config CFG_RTCCLK_DIVIDER_CONF to 16, the device is advertising and connectable,

But once sending read/write request the device stuck.