cancel
Showing results for 
Search instead for 
Did you mean: 

Waking from STOP mode U575

bpat
Associate II

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?

2 REPLIES 2
Imen.D
ST Employee

Hello @bpat 

It should be related to the known limitation in the STM32U575xx device errata.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

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.