adafruit / adafruit/Adafruit_CircuitPython_RGB_Display

Example code won't run on Rasberry Pi 5 (solved)

Open Beginner friendly
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
143
Forks
53
PR merge metrics
No merged PRs in 30d

Description

OS: Raspberry Pi OS Trixie
Kernel: 6.18.34+rpt-rpi-2712

When trying to run Example code: rgb_display_minipitfttest.py
It raises an error:
```python
Traceback (most recent call last):
File "/home/valtteri/test.py", line 11, in
cs_pin = digitalio.DigitalInOut(board.CE0)
File "/home/valtteri/py_venv/lib/python3.13/site-packages/digitalio.py", line 67, in __init__
self.direction = Direction.INPUT
^^^^^^^^^^^^^^
File "/home/valtteri/py_venv/lib/python3.13/site-packages/digitalio.py", line 97, in direction
self._pin.init(mode=Pin.IN)
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/valtteri/py_venv/lib/python3.13/site-packages/adafruit_blinka/microcontroller/generic_linux/lgpio_pin.py", line 81, in init
self._set_gpio_mode_in()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/valtteri/py_venv/lib/python3.13/site-packages/adafruit_blinka/microcontroller/generic_linux/lgpio_pin.py", line 130, in _set_gpio_mode_in
Pin._check_result(lgpio.gpio_claim_input(CHIP, self.id, lFlags=lflags))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/lgpio.py", line 755, in gpio_claim_input
return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio))
File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
raise error(error_text(v))
lgpio.error: 'GPIO busy'
```

Line 11:
`cs_pin = digitalio.DigitalInOut(board.CE0)`

I solved the error by using board.D23 insted.

Issue seems to be that OS thinks CE0 pin reserved for SPI and Blinka uses SPI differently than OS excepts.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the example file rgb_display_minipitfttest.py, especially line 11 where board.CE0 is assigned, and reproduce the GPIO busy error on Raspberry Pi OS Trixie using the reported environment. Compare the failing CE0 setup with the reported board.D23 workaround; done means the example runs without the GPIO busy error on Raspberry Pi 5.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.