Page 1 of 1
Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 11:17 am
by whatever213
Hello,
for a project i need the Pi 5 to function as a SPI slave.
According to the datasheet (
https://datasheets.raspberrypi.com/rp1/ ... herals.pdf) SPI4 should be the only available Instance via the GPIOs.
I wasn't able to activate it via dtoverlay and in the overlay map spi4 seems to be missing for the Pi 5 (
https://github.com/raspberrypi/linux/bl ... ay_map.dts). At least i couldn't find one with the bcm2712.
What am i missing here? And if this solution is not possible am i able to control SPI4 via the RPI1 peripherals directly?
Thank you very much!
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 11:45 am
by scotty101
Every post I have seen in the past on this topic has suggested that the Pi can't be used as an SPI slave.
Things may have changed however.
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 1:18 pm
by PhilE
Pi 5/RP1 does have an accessible SPI slave, SPI4 on GPIOs 8-11, but the Linux driver for the DW SPI interfaces in RP1 does not support target/slave mode, hence the lack of overlay support. However, I see that the "next" branch of the kernel has just gained a patch titled "spi: dw: add target mode support". If you were to mention this in an issue on our kernel GitHub repo (
https://github.com/raspberrypi/linux/issues), there's a chance it could be backported - it depends on how many supporting patches are required in order for it to be made to work.
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 3:15 pm
by PhilE
I was curious, so I took a look at the backport. Going back to 6.12 would be painful, but 6.18 is much simpler, and likely to be the next LTS kernel.
https://github.com/raspberrypi/linux/pull/7132 is a backport to rpi-6.18.y. It lacks overlay support, but it is a first step.
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 5:04 pm
by whatever213
First of all thank you very much! That sounds really good.
Now my next dumb (sorry, i haven't done this before) question:
How do i proceed from here? I guess it will take some time before the next kernel arrives so do i use the rpi-6.18.y version?
Can i just update the SPI kernel modules?
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 5:19 pm
by robertojguerra
I have only seen dedicated chips being SPI slaves: LCD controllers, DACs... things that can guarantee to respond in less than a microsecond, without any other control wires, like ACK, CTS, DTR.
With Linux orchestrating every function, I don't see it possible.
Maybe your Raspberry Pi and its master should be communicating over ethernet.
Re: Raspberry Pi 5 as a SPI Slave
Posted: Tue Nov 11, 2025 5:21 pm
by PhilE
You can install a 6.18 kernel now, provided you aren't using initramfs in order to boot (which you can check by setting "auto_initramfs=0" in config.txt and confirming that your Pi still boots).
All you need to do is:
Code: Select all
# Back up any important data, then...
$ sudo rpi-update rpi-6.18.y