2020-07-28 06:31 AM
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:
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();
}
Solved! Go to Solution.
2020-07-29 04:00 AM
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.
2020-07-29 04:00 AM
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.
2020-07-29 04:14 AM
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