cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup from standby falling edge

makavity
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
makavity
Associate II

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.

View solution in original post

2 REPLIES 2
makavity
Associate II

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
Chief

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