2024-12-24 02:29 AM - last edited on 2024-12-24 03:22 AM by SofLit
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?
2024-12-24 03:21 AM - edited 2024-12-24 03: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
2024-12-24 05: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 @SofLit said. How to do this? The simplest way: connect the EXTI pin to some other pin configured as push/pull.
2024-12-24 06: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.