cancel
Showing results for 
Search instead for 
Did you mean: 

what is the process for stop mode wakeup

David.Cheng
Associate II

I have some code like below

while (1)
 
  {
 
    HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_SET);
 
    HAL_Delay(1000);
 
    HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_RESET);
 
 
    HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
 
 
    if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 5, RTC_WAKEUPCLOCK_CK_SPRE_16BITS) != HAL_OK)
 
    {
 
      Error_Handler();
 
    }
 
 
    __HAL_RCC_PWR_CLK_ENABLE();
 
    HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
 
 
  }  
 
}

also I enable EXIT3 , i want to the detailed process if i trigger the EXIT3

if mcu in stop mode i trigger the EXIT3 does it need to reset the rtc timer in IRQ handler?

3 REPLIES 3
Mohamed Aymen HZAMI
ST Employee

Hello,

Which STM32 MCU are you using?

Regards,

Mohamed Aymen.

STM32L0K8

These would probably be a good examples

STM32Cube_FW_L0_V1.10.0\Projects\STM32L011K4-Nucleo\Examples\PWR\PWR_STOP_RTC

STM32Cube_FW_L0_V1.10.0\Projects\STM32L011K4-Nucleo\Examples\PWR\PWR_STOP

basically a hybrid thereof.

My expectation is that either interrupt source would wake, and you should deactivate the RTC wakeup in the EXTI callback if it wakes via the EXTI event.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..