cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 interrupt wake up from stop mode (pin PC12) ISSUE

milanvujovic
Associate II
Posted on November 06, 2015 at 19:48

Interrupt is working good when STM is in run mode, but when STM enter STOP mode interrupt from pin PC12 doesn't work, end after that interrupt doesn't work at all, even when STM enter run mode againt. It's seems like sleep somehow kill this interrupt.

This is my initialization:

 /*Configure GPIO pin : PC12 */

    GPIO_InitStruct.Pin = GPIO_PIN_12;

    GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;

    GPIO_InitStruct.Pull = GPIO_NOPULL;

    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

    HAL_NVIC_SetPriority(EXTI4_15_IRQn, 1, 0);

    HAL_NVIC_EnableIRQ(EXTI4_15_IRQn);

void EXTI4_15_IRQHandler(void)

{

  / USER CODE BEGIN EXTI4_15_IRQn 0 /

  / USER CODE END EXTI4_15_IRQn 0 /

  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12);

  / USER CODE BEGIN EXTI4_15_IRQn 1 /

  / USER CODE END EXTI4_15_IRQn 1 /

}

 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){

if (GPIO_Pin == GPIO_PIN_12){

   WakeUpFromISRChargerTrigger();

   UpdatePocketFinderStatus();

  }

}
0 REPLIES 0