cancel
Showing results for 
Search instead for 
Did you mean: 

Shutdown mode problem with STM32L4

jonathan239955_stm1_st
Associate II
Posted on April 10, 2017 at 09:56

Hello,

I have a board with the STM32L476RET6, the shutdown mode worked a time and now it resets just after the STM32 enters in shutdown mode. I tried the same program with another same board and the problem does not appear.

I thought it was a problem with an interrupt but even if I disable all interrupts, the problem persists. I also disabled RTC clock.

            __disable_irq();

            __disable_fault_irq();

            HAL_PWREx_EnterSHUTDOWNMode();

Thank you for your help,

Best Regards,

Jonathan

10 REPLIES 10
Wisnu Pramadi
Associate II

Hi guys,

try clearing the flags right before entering shutdown.

 // Your wakeup setup here
// ...
 
// Clear flasg
 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
 
// Enter shutdown
  HAL_PWREx_EnterSHUTDOWNMode();

I notice that the flags can be asserted after we setting up the wakeup pin. It can immediately wakeup the CPU if you haven't clear them right before entering shutdown.