GPIO pin 12 on RPi 4 doesn't pull-up
See original GitHub issueDescribe the bug
When attempting to use pin 12 in InputPullUp PinMode, the pin does not pull up. (This has been tested with multimeter.)
Steps to reproduce Just use the following code to configure the pin:
GpioController controller = new GpioController(PinNumberingScheme.Logical);
Console.WriteLine("Starting button test");
if (mode == 1)
{
controller.OpenPin(buttonNumber, PinMode.InputPullUp);
}
if (mode == 2)
{
controller.OpenPin(buttonNumber, PinMode.InputPullDown);
}
while (true)
{
if (controller.Read(buttonNumber) == PinValue.Low)
{
Console.WriteLine("Button pressed");
Thread.Sleep(TimeSpan.FromSeconds(1));
}
}
Expected behavior The pin (12) should be pulled up to 3.3V and when connected to the button, the code above should work.
Actual behavior The pin (12) stays at low.
Versions used
Add following information:
Versions used
SDK:
3.1.400-preview-015151 [C:\Program Files\dotnet\sdk]
Version of System.Device.Gpio
package: 1.0.0
NOTE: This code & setup works on RPi 3 B+. I have tested the pin itself by toggling high & low using C# code and it functions as expected. When using python to pull-up the pin it works as expected, that is why I am assuming its something to do with the System.Device.Gpio package.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
This is probably a coincidence. Package version 1.0.0 just doesn’t properly handle pullups for the Pi4 (since that requires a different low-level operation than on the Pi3, which was not documented properly at the time 1.0 was released). So that might just work, depending on the startup settings. It will fail when you try to change it (i.e. set it to pulldown) on any pin. Please try again with the prerelease version, as described in the readme here: https://github.com/dotnet/iot/blob/master/README.md
Note, there is an already existing issue for detection where some of the mentioned stuff doesn’t work: https://github.com/dotnet/iot/issues/1145