cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R9 strange behavior when awaking from shutdownMode

s m
Associate III

Hello,

I enter the shutdown mode with the following code statement

HAL_PWR_EnableWakeUpPin( PWR_WAKEUP_PIN1_LOW );
HAL_PWR_DisableWakeUpPin( PWR_WAKEUP_PIN2 );
HAL_PWR_DisableWakeUpPin( PWR_WAKEUP_PIN3 );
HAL_PWR_DisableWakeUpPin( PWR_WAKEUP_PIN4 );
HAL_PWR_DisableWakeUpPin( PWR_WAKEUP_PIN5 );
 
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF3);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF4);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF5);
HAL_PWREx_DisableInternalWakeUpLine();
 
HAL_PWREx_EnterSHUTDOWNMode( );

If I wake up the system with PWR_WAKEUP_PIN1, I set the GPIO15 from PORTH to high.

I initialized the PORT and GPIO (CubeMX generates the code).

The result is that the system is hanging. If I reset the GPIO to low before entering the shutdown mode, everything is working fine.

Am I missing something? Maybe someone can explain me if I doing something wrong.

Is there any bug know that happens when using shutdownMode on STM32L4+ series?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
s m
Associate III

Ok the problem is resolved.

I used inside the interrupt the RTOS message queue and after the reset it was not initialized.

Sometimes it worked, sometimes not, funny.

Sorry for that!

View solution in original post

1 REPLY 1
s m
Associate III

Ok the problem is resolved.

I used inside the interrupt the RTOS message queue and after the reset it was not initialized.

Sometimes it worked, sometimes not, funny.

Sorry for that!