Skip to main content
Visitor II
January 15, 2024
Question

Waking from STOP mode U575

  • January 15, 2024
  • 1 reply
  • 2131 views

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?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    January 15, 2024

    Hello @bpat 

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

    bpatAuthor
    Visitor II
    January 15, 2024

    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.