Working on Pi 5?

1,188 views
Skip to first unread message

cardre

unread,
Nov 23, 2023, 5:41:37 AM11/23/23
to bcm2835
Hello, just wondering if anyone has tried the library yet on a Pi 5?
I haven't got one yet to try, but curious to know if anyone else has seen if it works, given the new RP1 chip handling most of the hardware interfaces now.

Mike McCauley

unread,
Nov 23, 2023, 5:58:02 AM11/23/23
to bcm2835, cardre
Not tested here, yet.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone +61 7 5598-7474



Mark Dootson

unread,
Nov 23, 2023, 7:17:10 AM11/23/23
to bcm2835
Sadly it won't work.  The RP1 which handles the peripheral access now has little in common with the BCM2835 as far as I can see.

https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf

mike james

unread,
Nov 23, 2023, 8:46:14 AM11/23/23
to bcm2835
I can confirm that not only will it not work but the changes needed to make it work are big.
From the point of view of peripherals the 5 is more like a Pico in terms of hardware, registers etc.
I was hoping that a simple change of address base would bet the library working but it would take a
big rewrite.
mikej

mike james

unread,
Nov 23, 2023, 8:47:57 AM11/23/23
to bcm2835
Sorry I forgot to add that all of the gpio libraries also don't work with the 5.
Only the linux gpio and other drivers work - I'm still checking them but
so far no problems.
mikej

Mike McCauley

unread,
Nov 23, 2023, 2:38:14 PM11/23/23
to bcm...@googlegroups.com
Thanks for the headsup.

Cheers.

cardre

unread,
Nov 26, 2023, 4:50:31 AM11/26/23
to bcm2835
OK, I'm guessing that was what was going to happen. So I've got some work to do to convert my realtime thread/code to work on a Pi 5 and a SPI bus.

Hussam Al-Hertani

unread,
Feb 16, 2024, 12:38:42 PM2/16/24
to bcm2835
Has anyone started working on porting libbcm2835 to the Raspberry Pi 5 ? Please let me know if there's a group working on this. I'm happy to help in anyway i can.

Hussam

Jaron van der Velden

unread,
Feb 16, 2024, 3:09:27 PM2/16/24
to bcm2835
I would love to help with porting the bcm2835 library to raspberry pi 5, i'm a bit confused though at the moment how these drivers are compatible for instance with the pi4 which uses the BCM2711 but I can't find anything regarding BCM2711 in the whole  bcm2835 library project.
For me specifically I want to use a project that has the bcm2835 library included ant it won't work because of it on my pi5
The Raspberry pi documentation states that the standard linux driver for raspberry pi's is spi-bcm2835, this also seems to work for raspberry pi 4 and I think also pi 5. But also when looking at it's source I don't see any mention of BCM2711..

Can someone explain why:

There is no mention of BCM2711 eventhough there seems to be work done in there to make it compatible with the pi 4?

Someone would use bcm2835 library driver instead of the kernel provided drivers (spi-bcm2835) for bcm2835? (accessable via spidev)

Apologies if these are noob questions but they are really getting me confused...

Brendan Doherty

unread,
Jun 14, 2024, 11:46:14 PM6/14/24
to bcm2835
If you imagine the BCM2xxx chip as a typical Integrated Circuit (much like any IC chip often used for peripheral hardware), then you will understand that the BCM2835 library accesses the GPIO pins by interacting with the BCM2xxx chip's internal registers. CPU registers are a property used to make any type of processor, including peripheral IC chips. Prior to RPi5, this approach was possible because the GPIO pins were connected directly to the CPU.

With the RPi5, the GPIO pins are no longer directly connected to the CPU (BCM2712 on RPi5). Instead, they are abstracted via a new RP1 chip (a custom IC chip) that is connected to the BCM2712 through a PCI-express port. This is why adapting the BCM2835 library to support the RPi5 is a lot of work. And, adding such hardware support will likely result in an incompatibility with older RPi models or prove nearly impossible to maintain backward compatibility (given that the BCM2835 library is ultimately maintained by 1 person with no promise of financial reimbursement).

It is not just a matter of hardware compatibility and having enough motivated developers. It is more of a concern with library design vs hardware schematics. The BCM2835 library simply wasn't designed to work with the newer hardware schematics of RPi5 (& likely newer RPi models in the future).

There is a long history of why the implementation in libraries like RPi.GPIO (for python users), PiGPIO, BCM2835, and WiringPi are not the best approach. In the past, the Linux kernel's GPIO interface was woefully inadequate to satisfy the needs of the maker community. But this has changed as of Linux kernel v4.8 (back in 2016). And, the workaround implementations in most popular libraries were really just well-coded hacks to circumvent or augment the Linux kernel. Such implementations can pose a physical threat to users' hardware. Simply put, if you're using `sudo` to interact with hardware, then the OS/hardware wasn't designed well enough to be utilized by end-users.
Reply all
Reply to author
Forward
0 new messages