- whatever213
- Posts: 2
- Joined: Thu Jun 29, 2017 2:21 pm
Raspberry Pi 5 as a SPI Slave
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!
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
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.
Things may have changed however.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter
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
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
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
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?
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
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.
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
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:
All you need to do is:
Code: Select all
# Back up any important data, then...
$ sudo rpi-update rpi-6.18.y
Return to "Interfacing (DSI, CSI, I2C, etc.)"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion