Original Raspberry 7 inch Touch Display
Set up an original Raspberry 7 inch touch display mounted on a Raspberry 4B for touchpi.
Tested with Raspberry Pi OS Bookworm Lite.
We accept no liability for any problems that may arise when following this procedure.
Note
There is now driver installation necessary. Everything works out of the box.
Because of the used hardware case, it was necessary to rotate the display 180 degrees.
Install Image
It is a good idea to save some system files after installation and first boot of the Raspberry Pi OS Bookworm Lite image.
Image installation is described here: Installation.
Origin /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=d0f3b820-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=DE
Origin /boot/config.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 | # For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Additional overlays and parameters are documented
# /boot/firmware/overlays/README
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Disable compensation for displays with overscan
disable_overscan=1
# Run as fast as firmware / board allows
arm_boost=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[all]
|
Update OS withsudo apt update && sudo apt upgrade --yes
sudo apt install --yes --no-install-recommends git xorg x11-apps xinput-calibrator
Changes in /boot/cmdline.txt with
sudo nano /boot/cmdline.txt
add video=DSI-1:800x480@60,rotate=0
to the end of the line.
This change is not needed, but makes your cmdline.txt more readable.
Especially when you want to rotate your display.
Changed /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=d0f3b820-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=DE video=DSI-1:800x480@60,rotate=180
Reboot
Run X window server in background
sudo -b /usr/lib/xorg/Xorg :0
test with calling e.g. DISPLAY=:0.0 xcalc
Rotation (screen and touch)
You can rotate the touch display with changes in the boot/cmdline.txt
and /usr/share/X11/xorg.conf.d/40-libinput.conf
file.
Edit with sudo nano
.
/boot/cmdline.txt |
/usr/share/X11/xorg.conf.d/40-libinput.conf |
video=DSI-1:800x480@60,rotate=0 (power connector down) |
Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1" Option is optional. Not needed in the file. |
video=DSI-1:800x480@60,rotate=90 (power connector left) |
Use TransformationMatrix 90 ->
Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1" |
video=DSI-1:800x480@60,rotate=180 (power connector up, preferred layout) |
Use TransformationMatrix 180 ->
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1" |
video=DSI-1:800x480@60,rotate=270 (power connector right) |
Use TransformationMatrix 270 ->
Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1" |
Origin /usr/share/X11/xorg.conf.d/40-libinput.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | # Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
# Identifier "something or other"
# MatchDriver "libinput"
#
# MatchIsTouchpad "on"
# ... other Match directives ...
# Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
|
Changed /usr/share/X11/xorg.conf.d/40-libinput.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 | # Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
# Identifier "something or other"
# MatchDriver "libinput"
#
# MatchIsTouchpad "on"
# ... other Match directives ...
# Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
|
Read more about offsets, scaling and rotation here.