• sales

    +86-0755-88291180

3.5inch RPi LCD (A) Manual Configuration

For Bullseye 64-bit System

Install Imager

Please download the bullseye imager 64-bit from Raspberry Pi website.
1) Download it on the PC and unzip it to get the ".img" file.
2) Connect the TF card to the PC, open Win32DiskImager.exe software, select the system image downloaded in step 1, and click 'Write' to write the system image. Then, open the TF card file folder.
3) Download and unzip the waveshare35a.dtbo device tree file to add it to the /boot/overlay folder.
4) Connect the TF card to the Raspberry Pi, boot the Raspberry Pi, and log in to the Raspberry Pi terminal (you can connect the Raspberry Pi to the HDMI display or use SSH to remotely login).

Configure Driver File

Open the "config.txt" file under the boot directory, comment out "dtoverlay=vc4-kms-v3d", and add the following at the end of [all]:

dtparam=spi=on
dtoverlay=waveshare35a

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=0

Config Touch

Add the following codes in the terminal:

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

Add the following content in 99-calibration.conf file:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3932 300 294 3801"
        Option  "SwapAxes"      "1"
        Option "EmulateThirdButton" "1"
        Option "EmulateThirdButtonTimeout" "1000"
        Option "EmulateThirdButtonMoveThreshold" "300"
EndSection

FBCP Porting

Network is required for this step:

sudo apt-get install cmake
wget  https://files.waveshare.com/upload/1/1e/Rpi-fbcp.zip
unzip Rpi-fbcp.zip
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp

Set Auto-start

sudo nano /etc/rc.local

Add the following codes before "exit 0":

sleep 7
fbcp &


sudo reboot

Reboot it, and the screen displays normally.

For Bookworm System

For Raspberry Pi 4 & Raspberry Pi 5

Download and Compile fbcp

Open the Raspberry Pi terminal and execute:

sudo apt install libraspberrypi-dev -y
sudo apt-get install unzip -y
sudo apt-get install cmake -y
sudo wget https://files.waveshare.com/upload/1/1e/Waveshare35a.zip
sudo unzip ./Waveshare35a.zip
sudo cp waveshare35a.dtbo /boot/overlays/
sudo wget https://files.waveshare.com/upload/1/1e/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

Edit "config.txt" file:

sudo nano /boot/firmware/config.txt

Blocking the following sentence:


Add the following code at the end of config.txt:

dtparam=spi=on
dtoverlay=waveshare35a
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=0

Set Auto-start startx and fbcp

  • Open ".bash_profile". If there is no ".bash_profile" file, you can create one:
sudo nano ~/.bash_profile

Add the following code at the bottom of the ".bash_profile" file:

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
    export FRAMEBUFFER=/dev/fb0
    fbcp &
    startx  2> /tmp/xorg_errors
fi
  • Open the "99-fbturbo.~" file, if it exists, you need to check fb is "fb0":
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.~

Add the following code in "99-fbturbo.~" file:

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

        Option          "SwapbuffersWait" "true"
EndSection

Set CLI Auto-login

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

After rebooting, the main screen can normally display.
Note 1: Please ensure the username of the Raspberry Pi is "pi", otherwise, it cannot automatically log in.
Note 2: After setting the above configuration, it may take a while to reboot the system and load SSH.

Configure Touch

  • Install calibrator software:
sudo apt-get install xserver-xorg-input-evdev 
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
sudo apt-get install xinput-calibrator
  • Edit "99-calibration.conf configuration" file:
sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Add the following content to the "99-calibration.conf" configuration file:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3932 300 294 3801"
        Option  "SwapAxes"      "1"
        Option "EmulateThirdButton" "1"
        Option "EmulateThirdButtonTimeout" "1000"
        Option "EmulateThirdButtonMoveThreshold" "300"
EndSection

Reboot to take effect.

sudo reboot

For All Raspberry Pi Versions

The operation must be based on bookworm-lite system. 64-bit lite, 32-bit lite

Download Needed Software

  • Update system:
sudo apt update && sudo apt upgrade && sudo apt full-upgrade -y
  • Install xorg service:
sudo apt-get install --no-install-recommends xserver-xorg -y
sudo apt-get install --no-install-recommends xinit -y
  • Install Desktop Manager:
sudo apt install lightdm -y
  • Install Raspberry Pi official GUI:
sudo apt install raspberrypi-ui-mods -y  
  • Install browser (optional):
sudo apt install chromium-browser -y

Download Driver

Open the Raspberry Pi terminal and execute:

sudo apt install libraspberrypi-dev -y
sudo apt-get install unzip -y
sudo apt-get install cmake -y
sudo wget https://files.waveshare.com/upload/1/1e/Waveshare35a.zip
sudo unzip ./Waveshare35a.zip
sudo cp waveshare35a.dtbo /boot/overlays/
sudo wget https://files.waveshare.com/upload/1/1e/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

Edit config.txt file:

sudo nano /boot/config.txt

Block the following sentences:

Add the following codes at the end of "config.txt":

dtparam=spi=on
dtoverlay=waveshare35a
hdmi_force_hotplug=1
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 640 480 60 6 0 0 0
hdmi_drive=2
display_rotate=0

Set Auto-start startx and fbcp

  • Open ".bash_profile". If there is not ".bash_profile" file, you can create one:
sudo nano ~/.bash_profile

Add the following code at the bottom of ".bash_profile" file:

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
    export FRAMEBUFFER=/dev/fb0
    fbcp &
    startx  2> /tmp/xorg_errors
fi
  • Open the "99-fbturbo.~" file, if it exists, you need to check fb is "fb0":
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.~

Add the following code in "99-fbturbo.~" file:

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

        Option          "SwapbuffersWait" "true"
EndSection

Set CLI Auto-login

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

After rebooting, the main screen can normally display.
Note 1: Please ensure the username of the Raspberry Pi is "pi", otherwise, it cannot automatically log in.
Note 2: After setting the above configuration, it may take a while to reboot the system and load SSH.

Configure Touch

  • Install calibrator software:
sudo apt-get install xserver-xorg-input-evdev 
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
sudo apt-get install xinput-calibrator
  • Edit "99-calibration.conf" file:
sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Add the following content to "99-calibration.conf" file:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3932 300 294 3801"
        Option  "SwapAxes"      "1"
        Option "EmulateThirdButton" "1"
        Option "EmulateThirdButtonTimeout" "1000"
        Option "EmulateThirdButtonMoveThreshold" "300"
EndSection

Reboot it to take effect:

sudo reboot
TAG: Modbus Raspberry Pi Pico 2 RP2350B RP2350-PiZero Development Board PSRAM DVI For HDMI ESP32 S3 LCD Camera Development Board 2 inch Display QMI8658 Sensor / Battery Port LVGL/HMI For Arduino Industrial ESP32 S3 AI 7inch (C) Development Board 7 inch TouchScreen Display Sensor ESP32-S3 A7670E 4G development board supports LTE Cat-1/2G/GNSS positioning/WiFi/Bluetooth Raspberry Pi USB Camera 5MP OS05A10 Distortion-Free USB 2.0 For Jeston RDK 3.5inch RPi LCD (A) Manual Configuration STLINK Raspberry Pi Mipi display Aluminum Heatsink Raspberry Pi 2inch LCD Raspberry Pi 3.5 inch LCD G Display Resistive TouchScreen 60fps ST7796 320x480 Also For Arduino/Pico2/ESP32/RP2040/RP2350 NanoKVM-Lite Raspberry Pi MLX90640 ESP32-P4 Core Board 32MB PSRAM 16MB Flash Raspberry Pi 5 CR2032 Mini TOF Time-of-Flight Laser Ranging Radar Sensor Compatible UART with Arduino Raspberry Pi ESP32 and Pico Sipeed Lichee Tang Nano 4K FPGA MINI Development Board W1NSR-LV4C GOAI Gowin Raspberry Pi Pico 2 RP2350 2.8 inch LCD Capacitive TouchScreen Development Board 240x320 Display QMI8658 6-Axis /PCM5101 Audio /SD /RTC /Battery Port Sipeed MaixCAM Pro AI Camera Kit SG2002 RISC-V YOLO OpenCV Audio WIFI6 Linux Board IMU MicroPhone Speaker