cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55: Timerserver periodic wakeup from deep sleep

hardik
Associate II

I have done following configuration for RTC:

static void MX_RTC_Init(void)
{

/* USER CODE BEGIN RTC_Init 0 */

/* USER CODE END RTC_Init 0 */

/* USER CODE BEGIN RTC_Init 1 */

/* USER CODE END RTC_Init 1 */

/** Initialize RTC Only
*/
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;

if (HAL_RTC_Init(&hrtc) != HAL_OK)
{
Error_Handler();
}

/* USER CODE BEGIN RTC_Init 2 */

/* USER CODE END RTC_Init 2 */

}
With prescalers set as:

#define CFG_RTC_ASYNCH_PRESCALER (0X7F)

#define CFG_RTC_SYNCH_PRESCALER (0XFF)

 

The system is clocked with 32 MHz HSE.

I configured timer server to have periodic wakeups every 10 mins:

HW_TS_Create(CFG_TIM_PROC_ID_ISR, &Wakeup_mgr_Id, hw_ts_Repeated, Set_Wakeup_Task);
HW_TS_Start(Wakeup_mgr_Id, TRANSMISSION_TIME);
#define TRANSMISSION_TIME (10*60*1000*1000/CFG_TS_TICK_VAL) //

The system wake up every 10 mins and sets a task which is then picked up by ST's sequencer.

What I also observed was that there is a wakeup every 1 second when I configure the timer server. 

Is this expected behaviour?

I wanted to stay in STOP2 mode in between 10 mins interval but the system now wakes up every 1 second.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

I removed the timer server configuration and configured RTC wakeup directly. This issue disappeared.

This only happens with timer server configuration.

View solution in original post

3 REPLIES 3
Issamos
Lead II

Hello @hardik 

I suggest you to debug your code and try to localise the issue. It may be another wake up event/interrupt that takes your MCU out of STOP2 mode every 1 second.

Best regards.

II

I removed the timer server configuration and configured RTC wakeup directly. This issue disappeared.

This only happens with timer server configuration.

TomC
Senior

Hi, just wanted to say I have the same problem and would like to use the HW Timer Server library as it's already heavily integrated into the STM32WB STM32-WPAN CUBEMX generated code