pigpio icon indicating copy to clipboard operation
pigpio copied to clipboard

pigpio will not run on a Pi 5

Open JinShil opened this issue 9 months ago • 24 comments

pigpio is hard-coded to not run on a Pi5. See https://github.com/joan2937/pigpio/blob/c33738a320a3e28824af7807edafda440952c05d/pigpio.c#L7353-L7356

Do the maintainers plan to update pigpio to support the Pi5? Will this repository entertain pull requests to port pigpio to the pi5?

If not, please update the README and/or archive this repository to let users know.

JinShil avatar Nov 07 '23 09:11 JinShil

or archive this repository to let users know

... seems fairly rash given the installed base of a bazillion working devices vs the literal handful of pi5.

Do the maintainers plan to update pigpio to support the Pi5?

I have the aspiration to do so but my first quick read of the available docs suggest this will be a huge task, if not impossible without breaking compatibility.

Will this repository entertain pull requests to port pigpio to the pi~6~5?

Given the potentially monumental task, I think it would be wise to lean into the community for help. At a minimum, we would want to retain architectural oversight of the project.

guymcswain avatar Nov 07 '23 13:11 guymcswain

@guymcswain what would be so different between thos pi's 4 and 4 ? Isn't the pi meant to be backwards compatible? I'm basicly having the same banner on the systemd pigpiod run (it fails with the same message). All other gpio (raspi-gpio) also fail except for sysfs..

sworteu avatar Nov 07 '23 20:11 sworteu

@sworteu pi4 is supported. You need to open a separate issue and give details around the failure.

Isn't the pi meant to be backwards compatible?

Yes but this meaning ends at the os level. pigpio touches the metal.

guymcswain avatar Nov 08 '23 02:11 guymcswain

i tried libgpiod and that seems to work..;) https://kernel.googlesource.com/pub/scm/libs/libgpiod/libgpiod/+/v0.2.x/README.md installed trough: sudo apt install gpiod Note this is not pigpiod but gpiod. Perhaps some dev may find this useful to resume pigpiod.

sworteu avatar Nov 08 '23 14:11 sworteu

Maybe better to list the full log:

Nov 08 17:18:45 pi15 systemd[1]: Started pigpiod.service - Daemon required to control GPIO pins via pigpio.
Nov 08 17:18:45 pi15 pigpiod[2059]: 2023-11-08 17:18:45 gpioHardwareRevision: unknown rev code (d04170)
Nov 08 17:18:45 pi15 pigpiod[2059]: 2023-11-08 17:18:45 initCheckPermitted:
Nov 08 17:18:45 pi15 pigpiod[2059]: +---------------------------------------------------------+
Nov 08 17:18:45 pi15 pigpiod[2059]: |Sorry, this system does not appear to be a raspberry pi. |
Nov 08 17:18:45 pi15 pigpiod[2059]: |aborting.                                                |
Nov 08 17:18:45 pi15 pigpiod[2059]: +---------------------------------------------------------+
Nov 08 17:18:45 pi15 pigpiod[2059]: Can't initialise pigpio library

Looks like the revision code for the Pi 5 isn't whitelisted. This is the 8GB model; I think the 4GB model uses c04170.

ebaauw avatar Nov 08 '23 16:11 ebaauw

Or more precisely, the code for the BCM2712. https://github.com/joan2937/pigpio/blob/c33738a320a3e28824af7807edafda440952c05d/pigpio.c#L13791-L13830

I would create a PR, but I don't know what values to provide. I suspect the BCM2711 values won't work, now that GPIO is handled by the RP1 southbridge?

ebaauw avatar Nov 08 '23 16:11 ebaauw

pi5 is not supported by pigpio. pi5 is built with a new chip architecture that is incompatible with previous iterations.

guymcswain avatar Nov 08 '23 21:11 guymcswain

Some thoughts of a user: Perhaps one could evaluate which features still work on the Pi5 and which do not, and then create a slimmed-down PiGpio version just for the Pi5, to which the (still) missing features are gradually added. This would destroy backwards compatibility, but it would allow users to use still working features (if available) right away and at the same time create a basis for the future. Unfortunately, I do not have the expertise to support in the development. I am using PiGpio only, especially I2C and Wave Pulsing.

huesla avatar Nov 12 '23 11:11 huesla

Although I recommend the use of libgpiod, for direct hardware access you may find the RP1 support in pinctrl (https://github.com/raspberrypi/utils) useful as a starting point.

pelwell avatar Nov 12 '23 19:11 pelwell

... create a slimmed-down PiGpio version just for the Pi5, to which the (still) missing features are gradually added.

I would generally agree with this strategy, however, there are features/capabilities of pigpio that distinguish it from all other gpio libraries: the DMA read engine for sampling gpio and the DMA write engine for pwm, servo and custom waveforms. I have not taken the time to look into it yet but I'm hoping there exists compatible interfaces on Pi5 such as the VPU mailbox registers allowing the DMA peripheral (and supporting peripherals to pace DMA) to be memory mapped. If a more kernel friendly approach is available, that should be explored as well.

guymcswain avatar Nov 14 '23 13:11 guymcswain

I have just experienced this problem too

gpioHardwareRevision: unknown rev code (d04170)

so I am currently snookered

Brunnian avatar Feb 25 '24 12:02 Brunnian

Simply, I would like to add that I would appreciate seeing pigpio support the Pi 5.

In addition, I would be happy to provide testing support for any update to pigpio. While I'm not familiar with the architecture and design of pigpio, I would be willing to contribute to the development of the Pi 5 support.

dhrynyk avatar Mar 21 '24 14:03 dhrynyk

Is there a beer/coffee fund to which one could contribute to support RPi5 development? Appreciate it's a monumental task, but this is an excellent library and it would be a shame to see the ecosystem of RPi GPIO libraries grow ever larger!

standards

samskiter avatar Mar 25 '24 08:03 samskiter

Between this repo https://github.com/G33KatWork/RP1-Reverse-Engineering and the pinctrl source, it shouldn't be too hard to implement basic GPIO features... on the other hand, re-implementing servo control etc can become a little harder...

alessandromrc avatar May 05 '24 22:05 alessandromrc