2024-01-15 10:24 AM - edited 2024-01-15 11:08 AM
I am trying to get the STM32U575 to wake from STOP3 mode using the NUCLEO-U575ZI-Q dev board. I followed the example to enable the wakeup pin, clear any pending wakeup flag, and then go to sleep. I have this configured to pin PC13 which is the user push button, but the button does not wake the mcu. The push button does work for waking from SLEEP mode using the interrupt from the same pin. Here is the code I used from the example:
/* Enable WakeUp Pin PWR_WAKEUP_PIN2 connected to PC.13 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_HIGH_1);
HAL_NVIC_SetPriority(PWR_S3WU_IRQn, 0, 0);
NVIC_EnableIRQ(PWR_S3WU_IRQn);
HAL_SuspendTick();
/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_WAKEUP_FLAG2);
HAL_PWREx_EnterSTOP3Mode(PWR_SLEEPENTRY_WFI);
/* wake with push button*/
SystemClock_Config();
HAL_ResumeTick();
I'm using FreeRTOS but this code happens before FreeRTOS is initialized (for testing).
Any ideas why this is not working?
2024-01-15 11:20 AM
Hello @bpat
It should be related to the known limitation in the STM32U575xx device errata.
2024-01-15 12:41 PM
I'm not sure which errata you are referring to. I got it to work by disabling all UART Receive interrupts by calling
HAL_UART_AbortReceive_IT(&huart1);
HAL_UART_AbortReceive_IT(&huart2);
HAL_UART_AbortReceive_IT(&huart3);
I'm not sure why having interrupts enabled would prevent waking from STOP3 mode, but at least it works.