cancel
Showing results for 
Search instead for 
Did you mean: 

Terminated FreeRTOS app wakes up right away if RTC wakeup is used

gil_dobjanschi
Associate III

Hi,

I have developed an application for the STM32C562RET microcontroller that wakes up from standby mode, initially based on an example provided by ST. The non-FreeRTOS version of this application works fine (though there is a minor wake-up issue that is fixable). Subsequently, I created a FreeRTOS version of the same application that starts a task, and when the user presses a button, the vTaskEndScheduler() function is called to terminate FreeRTOS, which in turn calls void vPortEndScheduler(void) where the wake-up code is implemented.

 

void vPortEndScheduler(void) {
  HAL_RTC_WAKEUP_Start(HAL_RTC_WAKEUP_IT_ENABLE);
  LL_PWR_ClearFlag_SB();

  HAL_PWR_EnterStandbyMode();
}

 Despite the fact that FreeRTOS is no longer running, the MCU goes to standby and wakes up immediately.

Do you have any suggestions on how to make this work?

Thanks,

-Gil

 

0 REPLIES 0