Hi guys,
I need some help with implementing shutdown mode entry & wakeup by RTC/wakeup pin.
To bring some background into this - I’m moving my code from STM32L4P5 to STM32U575. On L4 MCU everything worked fine, I’ve created tasks that I’ve needed, and after completing all the work I’ve set the MCU to shutdown mode in one of the tasks. Only thing that could wake up the MCU was RTC alarm or pushing the button which was connected to one of the wakeup pins.
Now, when I moved this code to U5 MCU, the shudown mode/wakeup is not working anymore. I’ve tryied to run shudown / wakeup procedure on bare MCU without FreeRTOS and everything works as expected, so I’m assuming that the procedure is correct. The problem comes when I try to enter shutdown after vTaskStartScheduler(). After kernel starts running there is no way I can set the MCU to shutdown mode nor waking it up. Is there some extra step that I am missing ?
Shutdown procedure :
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
__HAL_PWR_CLEAR_FLAG(PWR_WUSCR_CWUF);
HAL_PWREx_EnterSHUTDOWNMode();