Question
EXTI11 HAL
Posted on October 06, 2016 at 13:48
I am trying to make EXTI11 work using the HAL libraries and run into troubles.
This is my configuration /*Configure GPIO pin : EXT11_Pin */ GPIO_InitStruct.Pin = GPIO_PIN_11; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); HAL_NVIC_SetPriority(EXTI15_10_IRQn, 2, 0); //some time later HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); //EXT11 file stm32f4it.c void EXTI10_15_IRQHandler(void) { /* Handle PD11 interrupt */ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); } //file interruptcallbacks.c void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin) { if (GPIO_Pin==GPIO_PIN_11
) { // FALLING if (EXTI->FTSR & 0x0400) { //ENABLE RISING EXTI->FTSR &= 0xFBFF; EXTI->RTSR |= 0x0400; } //RISING else if ((EXTI->RTSR & 0x0400)!=0) { //ENABLE FALLING EXTI->RTSR &= 0xFBFF; EXTI->FTSR |= 0x0400; } } } the issue I am facing, is that, as soon as I toggle the interrupt line, code jumps into Default_Handler. Disabling the interrupt works as expected. Thanks Fabio