-
Notifications
You must be signed in to change notification settings - Fork 5.2k
interrupts are not passed to userspace (e.g. poll()) when an interrupts occurs on a gpio pin on a raspberry pi 4 #5159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@folkertvanheusden Did you already contacted the author of libpigpio-dev before? |
@lategoodbye I did. And I verified with strace that it may not be related to libpigpio e.g. it performs the right steps (set input to in, set trigger to edge, perform poll() on fd). |
I'm not expert in libpigpio. How does it interact with the GPIOs (SOC register level or via /sys/class/gpio)? |
@lategoodbye via /sys/class/gpio (I'm not an expert in libpigpio either but I dug a bit in it) It's also with other GPIOs. I also checked one without pull-up. I trigger the interrupt via hardware (a switch connected to the gpio pin). Older kernel: I'll see if I can check that out. I'll keep you posted. |
GPIO 2
This works fine on "4.19.75-v7l+ # 1270 SMP Tue Sep 24 18:51:41 BST 2019". It does NOT work on "5.15.61-v7l+ # 1579 SMP Fri Aug 26 11:13:03 BST 2022". |
Just to make it clear: Kernel 4.19.75: Rpi 1, 2, 3 & 4 works correct? |
Yes! |
Well, that's not accurate: 4.19.75 has been tested on my rpi4 and there it works; i have not tested it on an rpi1. |
Hi, Update:
So somewhere between 5.15.32 and 5.15.61 it broke. |
It's working fine for me on a Pi 4 running 5.15.61. I've modified the test program so you can pass in a GPIO number, but that doesn't change the fundamental behaviour - your version also works for me. In the spirit of test code it is not defensively written, but it does avoid the I/O error caused by re-exporting the same GPIO.
|
Hi @pelwell, I've been testing all morning and started to see that sometimes it does work and sometimes it doesn't - with 5.15.56-v7+. In rpi3-001-start.png you see that after a fresh boot, the voltage on that pin (between the rpi and the tranceiver) is 0V. So what I'm thinking now:
|
GPIO 2 has an external hardware pull-up resistor - it's intended for I2C use - so it will not float. You can use For the record, I repeated the test on the latest
|
Hmmm I did not know that. Means I have to retest as with the scope I was using gpio 22 instead. Do you know if I can set gpio 22 to pull down explicitly? Not via /sys/class/gpio it looks like? |
|
F.w.i.w.:
Now it looks like if the library I use for that tranceiver does not reset that IRQ-flag before (re-)setting the tranceiver to receive and the gpio-pin to input, that the voltage stays at 0.84V for some reason. I think I can conclude this is a problem with that library and not neccessarily with the kernel(?) so I suggest we can close this issue? |
Describe the bug
If I run this on an rpi 1 or 2, then I see interrupts come in (the printf is invoked). On at least an rpi 3, I see no interrupts.
Steps to reproduce the behaviour
note that this example requires libpigpio-dev:
Device (s)
Raspberry Pi 4 Mod. B
System
Raspberry Pi reference 2022-01-28
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f01430c9d8f67a4b9719cc00e74a2079d3834d5d, stage2
Aug 9 2022 13:46:06
Copyright (c) 2012 Broadcom
version 273b410636cf8854ca35af91fd738a3d5f8b39b6 (clean) (release) (start)
5.15.56-v7+
Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: