2019-06-06 01:23 AM
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
2019-06-06 07:56 AM
Feels like either:
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?
2019-06-06 08:34 AM
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.
2023-10-06 03:28 PM
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