Skip to main content
Emanuele Zampieri
Associate II
May 7, 2019
Question

Exit from Low Power mode with wakeup pin STM32L072

  • May 7, 2019
  • 1 reply
  • 806 views

I'm using I-CUBE-LRWAN but i have a problem with the wakeup pin (PA0): i can't "wake up" the micro from low power mode with the pin PA0 (WKUP1) of STM32L072CZY.

At PA0 I put a pull-down and a button connected to 3V3 to generate a rising edge.

I tried to insert in the code a call to HAL_PWR_EnableWakeUpPin() function with all the possible parameters (PWR_WAKEUP_PIN1 and PWR_WAKEUP_PIN2), i didn't get any results.

My main is:

int main( void )
{
 /* STM32 HAL library initialization*/
 HAL_Init();
 
 /* Configure the system clock*/
 SystemClock_Config();
 
 /* Configure the debug mode*/
 DBG_Init();
 
 /* Configure the hardware*/
 HW_Init();
 
 /*Disbale Stand-by mode*/
 LPM_SetOffMode(LPM_APPLI_Id , LPM_Disable );
 
 //Configure the Lora Stack
 LORA_Init( &LoRaMainCallbacks, &LoRaParamInit);
 
 LORA_Join();
	
 __HAL_RCC_GPIOA_CLK_ENABLE();
 HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
 
 while( 1 )
 {
 LoRaMacProcess( );
 DISABLE_IRQ( )
 
 LPM_EnterLowPower( );
 
 ENABLE_IRQ();
 
 LED_Toggle(LED_BLUE);
 }
}

This topic has been closed for replies.

1 reply

Mohamed Aymen HZAMI
ST Employee
May 21, 2019

Hello,

You can refer to the Standby example in the STM32Cube _FW_L0.

This example based on the wake pin.

Best Regards,

Mohamed Aymen.