2024-03-07 01:20 AM
I'm unable to receive the external interrupt from both EXTI1 and EXTI8 interrupt lines
The triggering is set to faling edge detection and the pin is pulled up externally and the push button connected to the pin shorts it with the ground to create faling edge pulse.
But when I debug the program isn't entering the Interrupt callback funtion when it encounters falling edge.
Any help will be appreciated.
Thanks a lot in advance.
Solved! Go to Solution.
2024-03-13 01:25 AM
Hello @Giridhara_Datta_G ,
After having a look at your example, I noticed that you're using a callback named HAL_GPIO_EXTI_Callback()
which is used in oldest HAL products while you need to use HAL_GPIO_EXTI_Falling_Callback() in your case.
After making the fix, the callback is called when one of the two EXTI interrupts is fired.
Hope it helps.
2024-03-07 03:32 AM
Hello,
I don't see an issue in your test code!
Unfortunately I don't have an L5 board to do the test.
Meanwhile, Are you sure there is nothing connected externally to PB1 and PA8 (except the pull-ups)?
And it you try to test these I/Os in output mode and toggle them? are you seeing something on their outputs (just to ensure that they are not broken)?
2024-03-07 03:59 AM
When I observe the GPIO levels in the live update of the GPIOB->IDR1 Register under SFRs I'm seeing the change in the levels according to my input. But that is not reflecting to the ISR funtion. the falling edge is not triggering the callback function.
There is nothing else connected to the interrupt pins except the pull-up. the same code and the pullup circuit is working fine with the corresponding pins in STM32L432kc Nucleo board.
2024-03-07 04:39 AM
Is there any other configuration settings that I have missed?
2024-03-07 06:20 AM
> When I observe the GPIO levels in the live update of the GPIOB->IDR1 Register under SFRs I'm seeing the change in the levels according to my input.
So you observe PB8 is changing?
> #define NDRDY_Pin GPIO_PIN_8
> #define NDRDY_GPIO_Port GPIOA
> #define NDRDY_EXTI_IRQn EXTI8_IRQn
You defined the pin as PA8. GPIOB->IDR won't have any effect on it. Maybe recheck your pin assignments/assumptions here.
Always helps to show screenshots to show us what you're seeing.
2024-03-11 12:31 AM
> So you observe PB8 is changing?
I have defined 2 interrupts here i.e,
> #define NDRDY_Pin GPIO_PIN_8
> #define NDRDY_GPIO_Port GPIOA
> #define NDRDY_EXTI_IRQn EXTI8_IRQn
and
> #define NDRDY_Pin GPIO_PIN_1
> #define NDRDY_GPIO_Port GPIOB
> #define NDRDY_EXTI_IRQn EXTI1_IRQn
I have easy controll on pin PB1 as it is connected to the external pushbutton with a pull-up circuit.
when the pushbutton is not pressed :
GPIOB -> IDR1 is high
when the pushbutton is pressed :
GPIOB -> IDR1 is becoming low
2024-03-11 08:12 AM
Hello @Giridhara_Datta_G ,
I will try the project during this week with NUCLEO-L552ZE-Q board and get back to you as soon as I have an answer/feedback.
2024-03-13 01:25 AM
Hello @Giridhara_Datta_G ,
After having a look at your example, I noticed that you're using a callback named HAL_GPIO_EXTI_Callback()
which is used in oldest HAL products while you need to use HAL_GPIO_EXTI_Falling_Callback() in your case.
After making the fix, the callback is called when one of the two EXTI interrupts is fired.
Hope it helps.
2024-03-13 03:16 AM
Thanks a lot @SofLit!! ,
Changing the callback function from
>HAL_GPIO_EXTI_Callback()
to
>HAL_GPIO_EXTI_Falling_Callback()
solved the issue