2023-07-04 08:20 AM
Hi,
I am working on a custom hardware based on STM32MP1 mpu and also uses some other peripherals too. For our use case, we are using Yocto Linux. I am using the pin PA12 as an input GPIO interrupt, configured to trigger for falling edge. The interrupt works fine and gets triggered whenever the pin level goes low.
I need to use an led also as part of the application which is connected on-board to PD12. I opened the /sys/class/gpio/export and write the pin no. to the file and then set the direction as out in direction file.
But when the GPIO pin is enabled, the interrupt is not triggering. When we disable the GPIO pin and test, the interrupt works fine. The same happens if I enable the same pin no. on any GPIO port, whether it is PB12 or PC12 or PF12. I checked the registers also but everything is fine.
Can anyone help me with this issue. I am really stuck with this problem.
REGISTER | ADDRESS | VALUE | |
EXTI_FTSR1 | 0x5000D004 | 0x00001000 | |
EXTI_RTSR1 | 0x5000D000 | 0x0 | |
EXTI_EXTICR3 | 0x5000D068 | 0x0 | |
EXTI_EXTICR4 | 0x5000D06C | 0x0 |
2023-07-05 01:14 AM
Hi @Deepaks020 ,
I don't know what may happens but AFAIK the way you try to enable the GPIO through export file is not a recommended method in OpenSTLinux
I think you might manage it from Device Tree.
Please browse following wiki page :
How to control a GPIO in userspace
GPIO device tree configuration
Hope it help
Olivier
2023-07-05 07:53 AM
Thank you Olivier for the quick response. And, let me try to enable the GPIO, the way you suggested and test. I will update you soon.
Thanks