STM32G0 Stop 1 with wake on event
I'm trying to do something that seems simple if you go a search. I want the module to sleep. Then I will wake it with voltage on pin B6. I don't want an interrupt. Just an event. People mix event and interrupt so much and all the examples I see are based on interrupt so its nearly impossible to find any that actually are about events.
From what I can see it should be very simple. But my module does not sleep. It wakes immediately.
hack of my sleep code
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
adcDeInit();
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING; /* Configures: EXTI_EXTICRx, RTSR1, FTSR1, EMR1, IMR1*/
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);
}
From what I have read the module should be in STOP1 mode now. But what I see is it just enters and immediately exits. I don't see any flags set in RPR1 or FPR1. Should I?
Note: This module has UCPD and UART and other clocks that I have not turned off. EMR1 = 0x40; IMR1 = 0xFFFC0000; but interrupt should not wake the MCU only event right?
