Accessing GPIOs over pin 26 causes an exception on a Pi 4B

Bug #1901826 reported by Juerg Haefliger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rpi.gpio (Ubuntu)
Invalid
Medium
Unassigned
Bionic
Triaged
Undecided
Unassigned
Focal
Triaged
Undecided
Unassigned

Bug Description

[Impact]

With Focal running on a Pi 4B accessing any GPIO over 26 causes an exception:

$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as gpio
>>> print(gpio.VERSION)
0.6.5
>>> gpio.setmode(gpio.BOARD)
>>> gpio.setup(22, gpio.IN)
>>> gpio.setup(24, gpio.IN)
>>> gpio.setup(26, gpio.IN)
>>> gpio.setup(32, gpio.IN)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: The channel sent is invalid on a Raspberry Pi

Note that the above works fine on a Pi 3A+. Also, works fine on a Pi 4B after installing python3-rpi.gpio from Groovy:

$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as gpio
>>> gpio.setmode(gpio.BOARD)
>>> print(gpio.VERSION)
0.7.0
>>> gpio.setmode(gpio.BOARD)
>>> gpio.setup(22, gpio.IN)
>>> gpio.setup(24, gpio.IN)
>>> gpio.setup(26, gpio.IN)
>>> gpio.setup(32, gpio.IN)
>>> gpio.setup(36, gpio.IN)
>>> gpio.setup(38, gpio.IN)
>>> gpio.setup(40, gpio.IN)

[Test Case]

See above.

[Fix]

Backport version 0.7.0-0.2 from Groovy to Focal. The changes between Focal's 0.6.5 and Groovy's 0.7.0 are mostly fixes for Pi 4B support so backporting is easier/cleaner than applying individual fixes to 0.6.5.

[Regression Potential]

If this introduces a regression, users would probably see Python exceptions similar to what is shown above.

Revision history for this message
Juerg Haefliger (juergh) wrote :

The Pi is not properly detected with 0.6.5:
>>> print(gpio.RPI_INFO)
{'P1_REVISION': 2, 'REVISION': 'b03112', 'TYPE': 'Model B', 'MANUFACTURER': 'Sony', 'PROCESSOR': 'Unknown', 'RAM': 'Unknown'}

Probably needs:
https://sourceforge.net/p/raspberry-gpio-python/code/ci/03be41933c1b4fab3aa0daf2931adb4561029bd1/
https://sourceforge.net/p/raspberry-gpio-python/code/ci/3fe31bd67745a334cd7a33ba441ddf1993208b55/

Juerg Haefliger (juergh)
description: updated
Juerg Haefliger (juergh)
Changed in rpi.gpio (Ubuntu):
importance: Undecided → Medium
status: New → Invalid
Changed in rpi.gpio (Ubuntu Focal):
status: New → Triaged
Changed in rpi.gpio (Ubuntu Bionic):
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.