How to test GPIO interrupt handlers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-24 2:29 AM - last edited on ‎2024-12-24 3:22 AM by mƎALLEm
We are developing software that uses GPIO interrupts.
We would like to test if the GPIO interrupt handler is working properly, but is it possible to set the pin assigned to the GPIO interrupt High/Low in software?
Is this only possible by inputting a signal to the target GPIO from outside?
- Labels:
-
GPIO-EXTI
-
STM32H7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-24 3:21 AM - edited ‎2024-12-24 3:24 AM
Hello @pass3master ,
In next time please provide the MCU part number.
@pass3master wrote:
but is it possible to set the pin assigned to the GPIO interrupt High/Low in software?
Yes it's possible to set the rising and falling edges.
@pass3master wrote:
Is this only possible by inputting a signal to the target GPIO from outside?
Not clear what do you mean by this. As you will use GPIO it's for sure from outside.
Also you refer to one of the examples provided in CubeHAL: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/NUCLEO-H743ZI/Examples/GPIO/GPIO_EXTI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-24 5:45 AM
On most STM32s you can trigger any NVIC interrupt by software. But you likely want to test the whole path from the pin -> EXTI -> NVIC -> handler. As @mÆŽALLEm said. How to do this? The simplest way: connect the EXTI pin to some other pin configured as push/pull.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-24 6:07 AM
> is it possible to set the pin assigned to the GPIO interrupt High/Low in software?
Probably the easiest way is to configure the pin as an output and toggle it. That will trigger the interrupt.
