Skip to main content
Associate III
August 8, 2023
Solved

LOW POWER MODE

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();

	}

 

This topic has been closed for replies.
GwenoleBBest answer
ST Employee
August 8, 2023

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é

1 reply

GwenoleBBest answer
ST Employee
August 8, 2023

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é