inky
inky copied to clipboard
Pin Conflict spi0 CS0 on Inky Impression 7.3" with latest RPi OS
Hello,
I am encountering a persistent pin conflict issue when using a new Inky Impression 7.3" display on a fresh installation of the latest Raspberry Pi OS. I have followed all setup guides but am stuck in a loop between two different errors.
My Hardware:
Raspberry Pi Zero W Pimoroni Inky Impression 7.3" (800x480) Spectra 6 My Software:
OS: Raspberry Pi OS (32-bit), based on Debian Bookworm (Installed June 2025). Python: 3.11.2 (via a venv) Inky Library: Installed via pip after a full system update. The Problem (The "Catch-22"):
I have performed a completely clean OS installation with all updates applied.
If I enable both SPI and I2C in raspi-config (as per the Getting Started guide) and reboot, my Python script fails with the error:
Woah there, some pins we need are in use! ⚠️ Chip Select: (line 8, GPIO8) currently claimed by spi0 CS0 If I then disable the SPI interface in raspi-config (leaving I2C enabled) and reboot, the same script fails with a different error when inky.show() is called:
ERROR:root:An unexpected error occurred: [Errno 2] No such file or directory Steps to Reproduce:
Flash a clean 32-bit Raspberry Pi OS image. Run sudo apt update && sudo apt full-upgrade -y. Install dependencies: sudo apt install python3-pip python3-venv python3-numpy python3-libgpiod -y. Enable both I2C and SPI in sudo raspi-config and reboot. Create a venv and run pip install inky. Run a simple script to show an image. The pin conflict error occurs immediately. It seems the library is trying to control the CS pin directly while the kernel driver also has a lock on it, and there is no configuration that resolves this on the latest OS.
Thank you for any help you can provide.
I've just upgraded from v1.5.0 to v2.1.0 and I started to see the "Chip Select: (line 8, GPIO8) currently claimed by spi0 CS0" warning when I called show(). I see in the README there are some new lines since v2:
Additionally you may need to disable SPI's chip-select to avoid the error:
Woah there, some pins we need are in use!
⚠️ Chip Select: (line 8, GPIO8) currently claimed by spi0 CS0
This requires the addition of dtoverlay=spi0-0cs to /boot/firmware/config.txt.
I added dtoverlay=spi0-0cs to /boot/firmware/config.txt, saved the file, rebooted and now my display is updating correctly.
Apparently the very bottom of the README was a bad place to hide this information: https://github.com/pimoroni/inky?tab=readme-ov-file#chip-select-line-8-gpio8-currently-claimed-by-spi0-cs0
I think we might need to detect the OS version and have the installer include this line. Right now it doesn't because it could break anything else trying to use SPI. Uh, a prompt could maybe help there but 1% of people are going to read it 😬
Thanks for the reply @Gadgetoid
I see, so the issue is that GPIO8 can't be used by Inky when SPI has claimed it as a chip select pin. You mention detecting the OS version, what OS versions will see this problem?
I'm on a Raspberry Pi Zero W
I use the wHat yellow and get the following output:
Woah there, some pins we need are in use!
⚠️ Chip Select: (line 8, SPI_CE0_N) currently claimed by spi-bcm2835
My config.txt contains the following lines:
dtparam=spi=on
dtparam=i2c_arm=on
dtoverlay=spi0-0cs
If I remove the last line I get the error mentioned in the thread. If I remove the first line the spi becomes unavailable and so there is another failure.
All works flawlessly on version 1.5 of the library
Using version 11.11 of raspbian bullseye.
what OS versions will see this problem?
@r-rayns actually the OS version check is possible redundant, since anything capable of running the new libgpiod code should have GPIO8 exclusively claimed by SPI.
The main problem is that adding dtoverlay=spi0-0cs by default will break anything using SPI and expecting CS0/GPIO8 to function.
This is just the reality of Linux's transition away from the old GPIO-free-for-all.
I guess the options we have are:
- Prompt the user at install time, asking if they want to add
dtoverlay=spi0-0csand explaining the drawbacks. Does not work if theypip install. - Make the error message include instructions for adding
dtoverlay=spi0-0cs(and, again, explain the drawbacks) - Find some means of unloading the SPI driver on the fly and reloading it with the 0cs configuration. (Is this even possible!?)
@Gadgetoid
I think a combination of options 1 & 2 would make for a good approach.
- Add a check to the install script to see if GPIO8 is claimed by SPI, if it is ask them if they want to add
dtoverlay=spi0-0cs. - Add a little more clarity to the error message that is shown when running Inky.
I was also thinking it might be nice to have an additional method within the API that can check if GPIO8 is claimed by SPI or not. Such a method would allow 3rd party applications that use Inky to easily test the user's setup and feedback any issues.