Skip to content

Instantly share code, notes, and snippets.

@duckida
Created February 16, 2026 15:24
Show Gist options
  • Select an option

  • Save duckida/bd3819ed90877f9fa3ff096cce8b71de to your computer and use it in GitHub Desktop.

Select an option

Save duckida/bd3819ed90877f9fa3ff096cce8b71de to your computer and use it in GitHub Desktop.
How to use Inland 3.5" TFT with Raspberry Pi OS Bookworm

How to use Inland/Generic 3.5" TFT with Raspberry Pi OS Bookworm

  1. Edit /boot/firmware/config.txt. Add the following lines:
enable_uart=1
dtparam=spi=on
dtoverlay=piscreen,drm,speed=16000000
  1. Open sudo raspi-config. Under Advanced Options→Wayland, click X11. Then click OK & Finish. Don't reboot the Pi.

  2. Edit /etc/X11/xorg.conf.d/99-fbdev.conf Add this configuration:

   Section "Device"
       Identifier "myfb"
       Driver "fbdev"
       Option "fbdev" "/dev/fb0"
   EndSection
  1. Reboot your Pi

  2. The touchscreen should show the desktop. However, touch may not be calibrated.

If your screen is not calibrated, you can try using my calibration by adding the following to /etc/X11/xorg.conf.d/98-ads7846-calibration.conf:

Section "InputClass"
    Identifier "ADS7846 Calibration"
    MatchProduct "ADS7846 Touchscreen"
    Driver "libinput"
    # Scales the axes and corrects the 180-degree Y-axis inversion
    Option "TransformationMatrix" "1.1145 0 -0.0677 0 -1.1034 1.0577 0 0 1"
EndSection

If my calibration doesn't work, you can install xinput_calibrator. Then run DISPLAY=:0 xinput_calibrator & give the output to your favorite AI, along with these instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment