cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt fires multiple times on EXTI9-5

ROtte
Associate

hi,

I'm working on a STM32F303CC. on this mcu I'm using 6 buttons as interrupts. 5 of these buttons are connected to EXTI15-10 and one to EXTI9-5. the buttons on EXTI15-10 are working perfectly fine. although, the button on EXTI9-5 fires an incredible amount of times (randomly somewhere between 1500 to 4000 times or so).

it clears the flag, and when there's a breakpoint added to the interrupt function it only fires one time.

there is no bouncing, as checked with an oscilloscope and it has this problem with both falling and rising edge trigger detection.

what could be the problem?

thanks in advance,

Ruben

3 REPLIES 3
S.Ma
Principal

Feels like either:

  • EXTI source code working from EXTI15-10 has been copy pasted for EXTI9-5 with incomplete code edits
  • The configuration of the GPIO is wrong, or the EXTI bit position or GPIO reference is wrong.

Go in debug mode, then stop the code while it is running, view the GPIO and EXTI HW register settings. See what it does, can you manually clear the PR bit? What is the GPIO level? Is the bit set itself again?

Make sure it checks and clears the flag early in the routine, then do other things. There is a tail-chain issue if you clear it right before returning.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
RafaelSTM32
Associate III

void EXTI0_IRQHandler(void)

{

/* USER CODE BEGIN EXTI0_IRQn 0 */

 

/* USER CODE END EXTI0_IRQn 0 */

HAL_GPIO_EXTI_IRQHandler(IN_1_Pin);

/* USER CODE BEGIN EXTI0_IRQn 1 */

 

/* USER CODE END EXTI0_IRQn 1 */

}

 

/**

* @brief This function handles EXTI line1 interrupt.

*/

void EXTI1_IRQHandler(void)

{

/* USER CODE BEGIN EXTI1_IRQn 0 */

 

/* USER CODE END EXTI1_IRQn 0 */

HAL_GPIO_EXTI_IRQHandler(IN_2_Pin);

/* USER CODE BEGIN EXTI1_IRQn 1 */

 

/* USER CODE END EXTI1_IRQn 1 */

}

 

I put a breakpoint and both always are attended doesn't matter wich I pressed, I think is a similar case of ROtte