Pull-down not working for GPIOs for Pins over 26 on RPi4
See original GitHub issueDescribe the bug
Setting the pull-down on the RPi4 on GPIOs higher than 26 does not work on the RPi4.
I noticed the issue while working with the Button device which randomly triggers a low condition even if it is configured with a pull-down (the other end of the button is tied to +Vcc
).
Steps to reproduce
- Configure the pin as input with pull-down
- Physically connect a long wire on the pin, but do not connect the wire to anything
- Wave the hand over the wire or move the wire close to other devices Expected behavior The pull-down should guarantee stable readings
Actual behavior If the previous steps are done while looping and printing the values, you should be able to see zeros and ones in the output
Versions used Pre-release 2.0.0,21754
This is probably not an issue with the managed code. This bug has been observed in the native libraries on the RPi4:
- https://forums.raspberrypi.com/viewtopic.php?t=244375
- https://sourceforge.net/p/raspberry-gpio-python/tickets/168/#e2fa
- https://github.com/RPi-Distro/raspi-gpio/commit/80fa7d04eafb3ea34fc6f2d32de5f1873b5fb369#diff-02e8509be66e4ea16bb88f157ad4e4c4764871247883c0fa22d3751499b088c7R474
The last link points to the raspi-gpio tool which has been changed to support the RPi4. My question is whether those changes has been ported here or not.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
[Triage] can you re-test and make sure you’re getting the right GPIO driver?
Yes, those changes have been ported over long ago, and I’m sure that pull-ups and pull-downs work on the Pi4. There’s even an integration test at
RaspberryPiDriverTests.InputPullResistorsWork
that tests this (our lab has only Pi3’s though). However, I have never tested it with large pin numbers. But why should there be a difference?