Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CE0 and CE1 no longer usable on the Pi 5 in Python #179

Closed
makermelissa opened this issue Dec 19, 2023 · 8 comments
Closed

CE0 and CE1 no longer usable on the Pi 5 in Python #179

makermelissa opened this issue Dec 19, 2023 · 8 comments

Comments

@makermelissa
Copy link

I'm not 100% sure this is the correct place, but since the Python error is an OSError, it seems to make sense.

When trying to access CE0 or CE1 via Python libgpiod bindings, I get OSError: [Errno 16] Device or resource busy. It works fine on a Pi 4 using the exact same SD card, so it seems to be a combination of OS and Hardware. If I try using gpiozero, I get "GPIO busy", which is essentially the same error.

I am just trying to run a simple script to toggle the GPIO on and off.

I have no device tree overlays loaded and using the lite version of the OS. SPI is enabled, but not actively being used.

@makermelissa
Copy link
Author

I forgot to mention I have SPI enabled and can access the GPIO when it is disabled, but then SPI isn't available.

@makermelissa
Copy link
Author

makermelissa commented Dec 19, 2023

I did find a potential solution:

  1. I added dtoverlay=spi0-0cs to the bottom of /boot/firmware/config.txt
  2. I rebooted

After that code worked.

@holmesha
Copy link

@makermelissa Is that all you did? I have the same error when trying to use an Adafruit EYESPI beret for a display and still get the same error for the CE0. Nothing else could be using that pin...But when I run gpioinfo I see CE0 and CE1 are in use...

Tried your fix/reboot and still get the error...

@holmesha
Copy link

oooh I wonder if this is the solution? I haven't done this before so am worried I will mess up my gpio pins...

@makermelissa
Copy link
Author

makermelissa commented Dec 31, 2023

Yep, I updated that script so you can disable their usage by the OS. All it does is place the correct dtoverlay into the config along with parameters if needed. You can always just remove the dtoverlay from the config and it will go back to normal.

@holmesha
Copy link

Got it, thank you. Unfortunately that line alone in the config.txt file didn't seem to solve the issue for me.

@holmesha
Copy link

holmesha commented Jan 1, 2024

Actually never mind, I reloaded the Blinka library and it worked like a charm! Thank you for posting this Melissa! I thought I was going crazy...

@lurch
Copy link
Collaborator

lurch commented Jul 2, 2024

Sounds like this has been solved / worked-around? So closing...

@lurch lurch closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants