AnsweredAssumed Answered

How can I exit from standby mode using wakeup pin ?

Question asked by d.urbano on Oct 8, 2014
Latest reply on Oct 9, 2014 by sung.chen_chung
I'm using an stm32f401 mcu, mounted above Discovery platform, trying to understand how can I correctly use the standby low power mode; for this reason, I use the PA0 wake up to exit from this low power mode, but it doesn't work. The PA0, for my project, is setted as external interrupt, but when I use the standby mode, I configure it using the HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1) function that sets the EWUP bit in power control/status register, but when the mcu enter in standby mode and I push the button linked with PA0 pin, the mcu instead of restart code after the enter standby mode instruction, it resets. This is my code (only the code to enter/exit of standby mode):
  /* Set PDDS in power control register */
  PWR->CR |= (uint32_t) 0x00000002;
  /* Clear flaf wake up */
  while((PWR->CSR & (uint32_t) 0x00000001)!=0);//attesa che il WUF si azzeri (via HW)
  /* Enable PA0 wake-up functionalities */
  HAL_PWR_EnterSTANDBYMode();//<- qui il codice si ferma      
  HAL_GPIO_TogglePin(debugPin.port,;//<- qui il codice riprende la sua esecuzione
  /* Disable PA0 wake-up functionalities */
  f_EnterStdbyMode = false;
Please, can anyone tell me what's going on ?