2023-09-27 10:29 PM
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
Solved! Go to Solution.
2023-09-28 12:07 AM
I removed the timer server configuration and configured RTC wakeup directly. This issue disappeared.
This only happens with timer server configuration.
2023-09-27 11:54 PM
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
2023-09-28 12:07 AM
I removed the timer server configuration and configured RTC wakeup directly. This issue disappeared.
This only happens with timer server configuration.
2024-02-27 03:38 PM - edited 2024-02-27 06:45 PM
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