We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

4 posts • Page 1 of 1
freool
Posts: 11
Joined: Tue Oct 21, 2025 8:24 am

RPi5 gpio speed compared with RPi4

Fri Oct 24, 2025 6:12 pm

Hi,

I'm reading the GPIOs 10000000 times.

I'm using:
a) RPi4 using memory mapped io: *(gpio+13)&0xFFFFFFFFU using this
b) RPI5 using memory mapped io: gpio_get_all() using this

Here are the timings, for reading out 10000000 times:

a) RPi4: 0.154841 seconds
a) RPi5: 3.21899 seconds

So according to this... the RPi5 is 20 times slower than Rpi4, in reading gpios via memory mapped io.

Does this sound plausible?

cleverca22
Posts: 9593
Joined: Sat Aug 18, 2012 2:33 pm

Re: RPi5 gpio speed compared with RPi4

Fri Oct 24, 2025 6:30 pm

the pcie link on the pi5 adds a lot of latency

if you want to poll things faster, then you need to rig up PIO and DMA to automate it and push things in larger bursts

freool
Posts: 11
Joined: Tue Oct 21, 2025 8:24 am

Re: RPi5 gpio speed compared with RPi4

Fri Oct 24, 2025 8:48 pm

cleverca22 wrote:
Fri Oct 24, 2025 6:30 pm
PIO and DMA to automate it and push things in larger bursts
Sounds great!
Any pointers on how to do this? Any examples?

I'd need to trigger say 1000 reads of the following 8 GPIOs: 5, 6, 13, 19, 23, 24, 25, 26
and in the end get 1000 bytes.

And I need to be able to trigger this periodically, when necessary.
(Also: I wonder is the PIO can deliver bytes, or do shifts and masking necessary to obtain the bytes. Otherwise the PIO would have to deliver uint32_t via DMA... and I'd then do the shifts and masking later)

Thanks.


4 posts • Page 1 of 1

Return to "Interfacing (DSI, CSI, I2C, etc.)"

AltStyle によって変換されたページ (->オリジナル) /