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.

7 posts • Page 1 of 1
whatever213
Posts: 2
Joined: Thu Jun 29, 2017 2:21 pm

Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 11:17 am

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!

scotty101
Posts: 4585
Joined: Fri Jun 08, 2012 6:03 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 11:45 am

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.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 1:18 pm

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.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 3:15 pm

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.

whatever213
Posts: 2
Joined: Thu Jun 29, 2017 2:21 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 5:04 pm

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?

robertojguerra
Posts: 114
Joined: Thu Dec 05, 2024 6:35 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 5:19 pm

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.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Raspberry Pi 5 as a SPI Slave

Tue Nov 11, 2025 5:21 pm

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

7 posts • Page 1 of 1

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

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