RPi3/4/5 + Osoyoo 3.5″ SPI Screen – Bookworm Setup Guide (fbcp)

Hardware: Raspberry Pi 3B/3B+/4B/5

Screen: Osoyoo 3.5″ SPI Touchscreen (480×320)

System: Raspberry Pi OS Bookworm (released before 2025-05-13)

Method: fbcp (Framebuffer Copy)

Reference: https://osoyoo.com/2025/06/04/3-5spibookworm/

Purchase Links:

Buy from US
Buy from UK
Buy from DE
Buy from IT
Buy from FR
Buy from ES
Buy from JP

Version Notice: This tutorial is for Bookworm systems released before 2025-05-13. For newer Bookworm/Trixie systems, please use the updated tutorial without fbcp.
For Bullseye (Legacy): If you use Raspberry Pi OS Legacy (Bullseye), please follow a different tutorial: https://osoyoo.com/?p=50824

Osoyoo 3.5 inch SPI Screen

Table of Contents

1Burn OS Image

Burn the Raspberry Pi OS (Bookworm Version) with desktop to a TF card/micro SD card, and insert this card in your Raspberry Pi.

Download OS from: Raspberry Pi Official Website

Important: Please confirm that the SD card has enough space (at least 16GB recommended).
Note: If you use Raspberry Pi OS (Legacy/Bullseye), please follow: https://osoyoo.com/?p=50824

2Connect HDMI Monitor

Connect Raspberry Pi to your HDMI monitor or TV. Plug a keyboard and mouse into Raspberry Pi USB ports.

Warning: Do NOT install the 3.5″ SPI screen now! It will only show a white screen until the driver is configured.
HDMI Connection Setup

3Connect to Internet

Get the Raspberry Pi connected to the Internet via WiFi or Ethernet.

For WiFi setup guide, visit: Raspberry Pi Basic Tutorial

4Get IP Address

Open terminal and enter the following command:

hostname -I
Get IP Address
Note: Write down this IP address for SSH connection in Step 7.

5Install SPI Screen Hardware

Shut down the Raspberry Pi, remove the HDMI monitor, keyboard and mouse. Then install the 3.5″ SPI screen.

Pin Alignment: There are 40 pins on Raspberry Pi, but only 26 pins on the LCD connector. Align pins correctly starting from Pin 1!
SPI Screen Installation

6Power On

Power on the Raspberry Pi with the SPI screen installed.

Expected: Screen shows white initially. This is normal. The green LED should blink, indicating the system is booting.

7SSH Remote Access

Use PuTTY (Windows) or terminal (Mac/Linux) to SSH into Raspberry Pi. PuTTY guide

  1. Enter the IP address from Step 4
  2. Port: 22
  3. Click “Open” and login
PuTTY Connection

8Download and Compile fbcp

What is fbcp? fbcp copies the HDMI framebuffer to the SPI screen, allowing screen mirroring.

Execute via SSH:

sudo apt install libraspberrypi-dev -y
sudo apt-get install unzip cmake -y
sudo wget https://osoyoo.com/driver/osoyoo35b.zip
sudo unzip ./osoyoo35b.zip
sudo cp osoyoo35b.dtbo /boot/overlays/
sudo wget https://osoyoo.com/driver/Rpi-fbcp.zip
sudo unzip ./Rpi-fbcp.zip
cd rpi-fbcp/
sudo rm -rf build
sudo mkdir build
cd build
sudo cmake ..
sudo make -j4
sudo install fbcp /usr/local/bin/fbcp
Install libraspberrypi-dev
Install packages
Download fbcp
Compile fbcp
Note: libraspberrypi-dev is required for fbcp GPU access. On RPi5, fbcp is not used.

9Edit config.txt

sudo nano /boot/firmware/config.txt

9a. Comment out this line:

CRITICAL: Add # at the beginning to disable KMS.
#dtoverlay=vc4-kms-v3d
Comment out KMS

9b. Add at the END of the file:

# ========== SPI Screen Configuration ==========
dtparam=spi=on
dtoverlay=osoyoo35b:speed=20000000
hdmi_force_hotplug=1
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=2
display_rotate=2
Config.txt settings

Save: Ctrl+X, then Y, then Enter.

10Set Auto-start

10a. Configure .bash_profile

sudo nano ~/.bash_profile

Add the following code:

if [ "$(cat /proc/device-tree/model | cut -d ' ' -f 3)" = "5" ]; then
    # RPi 5B configuration
    export FRAMEBUFFER=/dev/fb1
    startx 2> /tmp/xorg_errors
else
    # Non-Pi5 configuration (RPi 3/4)
    export FRAMEBUFFER=/dev/fb0
    fbcp &
    startx 2> /tmp/xorg_errors
fi
bash_profile config
How This Works:
RPi 5: Direct framebuffer (/dev/fb1), no fbcp
RPi 3/4: Uses fbcp to copy HDMI to SPI screen

10b. Configure 99-fbturbo.conf (if exists)

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

If it exists, ensure content is:

Section "Device"
    Identifier  "Allwinner A10/A13 FBDEV"
    Driver      "fbturbo"
    Option      "fbdev" "/dev/fb0"
    Option      "SwapbuffersWait" "true"
EndSection

11Set CLI Auto-login

sudo raspi-config nonint do_boot_behaviour B2
sudo raspi-config nonint do_wayland W1
sudo reboot
Boot settings
CRITICAL: do_wayland W1 switches from Wayland to X11. SPI screens do NOT support Wayland!
After Reboot: Screen should display desktop. If still white, try power cycling.

12Configure Touch

After desktop works, connect via SSH and install calibration software:

sudo apt-get install xserver-xorg-input-evdev xinput-calibrator -y
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
Install evdev

Create calibration config:

sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Add:

Section "InputClass"
    Identifier "calibration"
    MatchProduct "ADS7846 Touchscreen"
    Option "Calibration" "241 3854 3885 240"
    Option "SwapAxes" "1"
EndSection
Calibration config

Reboot:

sudo reboot

Troubleshooting

Diagnostic Commands

# Check X Server errors
cat /tmp/xorg_errors

# Check framebuffer devices
ls -l /dev/fb*

# Check if fbcp is running (RPi 3/4)
ps aux | grep fbcp

# Check SPI overlay
dmesg | grep -i osoyoo

Common Errors

Error: White screen after reboot
Solution: Power cycle. Check config.txt for errors.

Error: fbcp: command not found
Solution: Re-compile fbcp:

cd ~/rpi-fbcp/build && sudo make && sudo install fbcp /usr/local/bin/fbcp
Error: Touch not working
Solution: Recalibrate: DISPLAY=:0 xinput_calibrator

One-Click Setup Script

Save as setup-spi-fbcp.sh and run:

chmod +x setup-spi-fbcp.sh && ./setup-spi-fbcp.sh
#!/bin/bash
echo "=== RPi3/4/5 + Osoyoo 3.5 SPI Screen Setup (fbcp) ==="

sudo apt-get update
sudo apt install libraspberrypi-dev -y
sudo apt-get install -y unzip cmake
cd ~
sudo wget -q https://osoyoo.com/driver/osoyoo35b.zip
sudo unzip -o -q ./osoyoo35b.zip
sudo cp osoyoo35b.dtbo /boot/overlays/
sudo wget -q https://osoyoo.com/driver/Rpi-fbcp.zip
sudo unzip -o -q ./Rpi-fbcp.zip
cd rpi-fbcp/ && sudo rm -rf build && sudo mkdir build && cd build
sudo cmake .. && sudo make -j4 && sudo install fbcp /usr/local/bin/fbcp

cd ~
sudo sed -i 's/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/' /boot/firmware/config.txt

if ! grep -q "osoyoo35b" /boot/firmware/config.txt; then
    sudo tee -a /boot/firmware/config.txt > /dev/null << 'CONF' # ========== SPI Screen Configuration ========== dtparam=spi=on dtoverlay=osoyoo35b:speed=20000000 hdmi_force_hotplug=1 max_usb_current=1 hdmi_group=2 hdmi_mode=1 hdmi_mode=87 hdmi_cvt 480 320 60 6 0 0 0 hdmi_drive=2 display_rotate=2 CONF fi cat > ~/.bash_profile << 'EOF' if [ "$(cat /proc/device-tree/model | cut -d ' ' -f 3)" = "5" ]; then export FRAMEBUFFER=/dev/fb1 startx 2> /tmp/xorg_errors
else
    export FRAMEBUFFER=/dev/fb0
    fbcp &
    startx 2> /tmp/xorg_errors
fi
EOF

sudo raspi-config nonint do_boot_behaviour B2
sudo raspi-config nonint do_wayland W1

sudo apt-get install -y xserver-xorg-input-evdev xinput-calibrator
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf

sudo tee /usr/share/X11/xorg.conf.d/99-calibration.conf > /dev/null << 'EOF'
Section "InputClass"
    Identifier "calibration"
    MatchProduct "ADS7846 Touchscreen"
    Option "Calibration" "241 3854 3885 240"
    Option "SwapAxes" "1"
EndSection
EOF

echo "=== Setup complete. Rebooting... ==="
sleep 3 && sudo reboot

Known Limitations

Reference Tutorials

Choose the tutorial that matches your Raspberry Pi model and OS version:

Bookworm / Trixie Setup Guide

RPi 4/5 • 2025-10-01 and later

Bookworm / Trixie RPi 4/5

Bookworm / Trixie Setup Guide (RPi3-specific)

RPi 3 • Extra X11 config required • 2025-10-01 and later

Bookworm / Trixie RPi 3

Bookworm Setup Guide (fbcp)

RPi 3/4/5 • Before 2025-05-13

Bookworm RPi3/4/5

Bullseye / Buster Setup Guide

RPi 3/4 • LCD-show driver

Legacy  RPi3/4

640×480 Virtual Resolution Guide

RPi 3 • x2fb scaling

Advanced • Trixie/Bookworm • 2025-10-01 and later

640×480 Virtual Resolution Guide

RPi 4/5 • x2fb scaling

Advanced • Trixie/Bookworm • 2025-10-01 and later

Not sure which to choose?
• Check your Pi model: cat /proc/device-tree/model
• Check your OS version: cat /etc/os-release

RPi Version Differences

Feature RPi 3/4 RPi 5
Framebuffer /dev/fb0 /dev/fb1
Method fbcp Direct
libraspberrypi-dev Required Not needed

Tech Support

Need help or have feedback? Submit a ticket and our team will get back to you within 1-2 working
days
. We appreciate your patience!

Working Time: 9 AM – 6 PM GMT+8 (Monday – Friday)

Contact Us: [email protected]

© 2026 Osoyoo | osoyoo.com

Last updated: 2026-02-10