AnsweredAssumed Answered

WakeUp from STOP using an EXTI GPIO LINE

Question asked by confalonieri.fabio on Nov 19, 2014
Latest reply on Nov 21, 2014 by confalonieri.fabio
I am having trouble to wake up the STM32F407 from the STOP condition using a GPIO EXTI line (PB 0).  

The same GPIO line is used when the STM32 is ON to switch it OFF (THIS WORKS PERFECTLY) and whenever it is OFF to Wake it Up (DOES NOT WORK).

The setup foresees to use the internal RTC to wake it up after 3' of inactivity.
The STM32F407 wake up after 3 minutes accordingly with the RTC setup but no matter to wake it up using the GPIO line.

The setup code follows:

 GPIO_InitStruct.Pin  = GPIO_PIN_0;
 GPIO_InitStruct.Mode  = GPIO_MODE_IT_RISING;
   GPIO_InitStruct.Pull  = GPIO_NOPULL;
   HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
 __HAL_GPIO_EXTI_CLEAR_FLAG(GPIO_PIN_0);
 NVIC_ClearPendingIRQ(EXTI0_IRQn);
 HAL_NVIC_SetPriority(EXTI0_IRQn, 2, 0);
 HAL_NVIC_EnableIRQ(EXTI0_IRQn);

HAL_PWREx_EnableFlashPowerDown();
 HAL_Delay(100);
 HAL_SuspendTick();
 HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);

This is the registers values captured just before entering in STOP mode
IMR[00020001] EMR[00000000] RTSR[00020001] FTSR[00000000] EXTICR[00000001]

Any suggestion is welcome.

Outcomes