Stop mode is woken by another EXTI line
STM32L071CBT wakeup power button PC13, PWM signal = PA11
I have a device that wakes every 20 seconds then goes to sleep, it can also wake when the power button is pressed, part of it's wake cycle it to check the servoInt pin for activity.
pin setup
/*Configure GPIO pin : servoInt_Pin */
GPIO_InitStruct.Pin = servoInt_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(servoInt_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : powerButton_Pin */
GPIO_InitStruct.Pin = powerButton_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(powerButton_GPIO_Port, &GPIO_InitStruct);stop mode is called
if(HAL_RTC_SetAlarm_IT(&hrtc, &RTC_AlarmStructure, RTC_FORMAT_BIN) != HAL_OK)
{
ErrorHandler(ERR_RTC_ALARM);
}
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);IRQHandler
void EXTI4_15_IRQHandler(void)
{
if(__HAL_GPIO_EXTI_GET_FLAG(servoInt_Pin) != RESET)
{
HAL_GPIO_EXTI_IRQHandler(servoInt_Pin);
}
else if(__HAL_GPIO_EXTI_GET_FLAG(powerButton_Pin) != RESET)
{
HAL_GPIO_EXTI_IRQHandler(powerButton_Pin);
}callback handler
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
switch (GPIO_Pin)
{
case servoInt_Pin:
servoFlag = true;
break;
case powerButton_Pin:
powerTick = HAL_GetTick();
break;
}
}the IRQ handler decerns the two exti lines and calls the callback correctly but the device wake on WFI from the servoInt_pin as well as the powerButton pin.
Is there a way to make WFI not be triggered from exti11?
