question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pull-down not working for GPIOs for Pins over 26 on RPi4

See original GitHub issue

Describe 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:

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:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
krwqcommented, Oct 13, 2022

[Triage] can you re-test and make sure you’re getting the right GPIO driver?

1reaction
pgrawehrcommented, Dec 11, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Raspberry pi 4 gpio pins not working
A video showing what happens to the GPIO during a test. A test with all GPIO okay. This program checks the Pi's (user)...
Read more >
How to set RPi4 (bcm2711) GPIO pull up/down
2711 has a different mechanism for pin pull-up/down/enable */ #define ... Set the GPIO port number with fix resistors to pull up/pull down....
Read more >
Using PullUp and PullDown Resistors on the Raspberry Pi
If you want to create a circuit on the Pi using its GPIO pins, it's important to understand "floating" - and how to...
Read more >
Using inputs and outputs together with RPi.GPIO – pull-ups ...
Today, it's time for us to combine inputs and outputs into the same script. It's nothing scary and it's not new either. It's...
Read more >
Raspberry Pi's GPIOs Default State
Here, HIGH means that there is a default pull up resistor on the pin, and LOW means there is a default pull down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found