Skip to main content
makavity
Associate
July 28, 2020
Solved

Wakeup from standby falling edge

  • July 28, 2020
  • 2 replies
  • 2379 views

Hello, i'm working with stm32l412cb on custom PCB, and I ran into trouble.

Is there any way to wake up MCU from standby by falling edge?

Here is scheme and code:

0693W000003BWPCQA4.png

0693W000003BWZqQAO.png

void enter_sleep() {
	HAL_EnableDBGStandbyMode();
	//HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
	HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_C, GPIO_PIN_13);
	HAL_PWREx_EnablePullUpPullDownConfig();
	 /* Disable all used wakeup sources: PWR_WAKEUP_PIN2 */
	 HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);
 
	 /* Clear all related wakeup flags*/
	 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
 
	 HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_LOW);
 
//	HAL_PWR_EnableWakeUpPin();
	HAL_PWR_EnterSTANDBYMode();
}

This topic has been closed for replies.
Best answer by makavity

Found a solution, if anyone is interested.

WKUP line is also controlled by a EXTI line, so, you should use these pins as EXTI with falling edge interrupt, and enable them as WKUP source.

2 replies

makavity
makavityAuthorBest answer
Associate
July 29, 2020

Found a solution, if anyone is interested.

WKUP line is also controlled by a EXTI line, so, you should use these pins as EXTI with falling edge interrupt, and enable them as WKUP source.

MM..1
Super User
July 29, 2020

I mean you miss and in pdf a WKUP pin event (configurable rising or falling edge)

EXTI work with SLEEP and STOP , but i not expert for cortex4