cancel
Showing results for 
Search instead for 
Did you mean: 

LOW POWER MODE

meena
Associate III

please help me to solve this .My prototype is going to stand by but never waking up.I have used WKUP4 how i can assign interrupts for this .

void Enter_sleep(void)
	{
	//enable PWR control clock
	 __HAL_RCC_PWR_CLK_ENABLE();
	// Set SLEEPDEEP bit of Cortex System Control Register

	SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
	//Select Standby mode
	 HAL_PWR_EnterSTANDBYMode();

	 //Clear wake up flag

	 if (__HAL_PWR_GET_FLAG(PWR_FLAG_WUF4) != RESET)
	    {
	      __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF4);
	    }


	//ENABLE WAKE UP PIN PA2 in this case

	HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_HIGH);

	// Request wait for interrupt

	__WFI();

	}

 

1 ACCEPTED SOLUTION

Accepted Solutions
GwenoleB
ST Employee

Hello @meena,
You entered in Standby before configuring the WKUP pin. Try first to configure WKUP4, then run HAL_PWR_EnterSTANDBYMode();

Best Regards,
Gwénolé

View solution in original post

1 REPLY 1
GwenoleB
ST Employee

Hello @meena,
You entered in Standby before configuring the WKUP pin. Try first to configure WKUP4, then run HAL_PWR_EnterSTANDBYMode();

Best Regards,
Gwénolé