Screen Usage
- LCD HDMI Screen Usage
- LCD DSI Screen Usage
- Use TFT Screen with G2T
DSI Usage
- After the image writing is completed, enter /boot/config.txt and add the following command
dtoverlay=vc4-kms-dsi-7inch
- Save and exit
Precautions:
- Ensure the main unit is powered off before installing the expansion board.
- Avoid using the expansion board in damp or dusty environments.
- When installing the screen, please note not to plug and unplug it while powered on. Pay attention to the direction of the screen cable to avoid damage.
- When installing the fan, pay attention to the current and voltage specifications of the fan to avoid damage.
- Note that UART1 is already enabled by default and does not need to be configured.
- Please flash the latest image, such as
mainsailos
, instead of upgrading the kernel. - The Raspberry Pi can use all interfaces!!!
- Note: The system kernel version used by the Raspberry Pi must be greater than
5.17.x
. Run the commanduname -r
to check the kernel version.
Download Link for Pre-installed TFTV2 System for Raspberry Pi
- System image for Raspberry Pi 3B/3B+/4B/CM4/5B
https://cdn.mellow.klipper.cn/IMG/Beta/RPI-TFT-IMG-new.img.xz
Installation of Screen Driver
- Note that you can directly use the pre-installed system.
- Project address: FLY-TFT
Introduction
FLY-TFT-V2 is a TFT LCD screen based on st7796, supporting both capacitive touch and resistive touch, with a resolution of 320x480, using SPI interface.
- You need to install KlipperScreen yourself.
System Installation
Note: The system kernel version used by the Raspberry Pi must be greater than 5.17.x
. Run the command uname -r
to check the kernel version.
Please flash the latest image, such as mainsailos
, instead of upgrading the kernel.
- Use Raspberry Imager to install the latest MainsailOS
- Download and install Raspberry Imager
- Open Raspberry Imager
- Click CHOOSE DEVICE
- Select the corresponding model according to your device
- Click CHOOSE OS
- Select Other specific-purpose OS
- Select 3D printing
- Select Mainsail OS
- Select the latest version. If your settings support 64-bit systems, choose rpi64
- Click CHOOSE STORAGE
- Select your storage device, such as an SD card
- Click NEXT, wait for installation to complete
Driver Installation
- Install FLY-TFT-V2 driver
git clone https://github.com/kluoyun/FLY-TFT.git
cd FLY-TFT
sudo chmod +x ./scripts/install.sh
./scripts/install.sh
Enabling TFT Display
- Touch requires enabling I2C support, the corresponding configuration is
dtparam=i2c_arm=on
- After installing the driver, add the overlay support
dtoverlay=fly-tft-v2
to the config.txt file - Open
/boot/config.txt
(for bookworm system, it's/boot/firmware/config.txt
)sudo nano /boot/config.txt
- Add the following configuration at the end of the file
dtoverlay=fly-tft-v2
- By default, the screen displays horizontally at 90 degrees. If you need to rotate the screen, use the following configuration
dtoverlay=fly-tft-v2,r90 # 90 degrees horizontal, same as default orientation
dtoverlay=fly-tft-v2,r270 # 270 degrees horizontal, flipped
dtoverlay=fly-tft-v2,r0 # 0 degrees vertical, portrait
dtoverlay=fly-tft-v2,r180 # 180 degrees vertical, flipped
- Only one configuration can be added, multiple configurations cannot be added
- Normally, the touch direction of the TFT will automatically follow the display direction without modifying the touch configuration in the system
- After adding to the end of the file, run the command
sudo reboot
to restart the system
Using TFT
- Ensure the hardware connection is correct
- The driver has been installed
- Added
dtoverlay=fly-tft-v2
overlay support to the/boot/config.txt
(for bookworm system, it's/boot/firmware/config.txt
) file - Some systems may have a default fb0 device, FLY-TFT will be assigned to the fb1 device. You need to modify the configuration file to enable the fb1 device
- Run the command
ls /dev/fb*
to view the device. If two devices, fb0 and fb1, appear, run the following command to enable the fb1 device (by default it is fb0) - Run the following command to modify the default configuration to the fb1 device
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf
Using KlipperScreen
- KlipperScreen is not installed by default in MainsailOS and needs to be installed manually
- Refer to KlipperScreen or use kiauh to install
- If KlipperScreen is successfully installed and step 5 is correctly completed, the KlipperScreen interface should now be displayed
All Available Configurations
-
speed
[requires parameter]: Set the maximum SPI clock frequency for the TFT, in Hz. Default is 96000000. If severe screen artifacts occur, reduce this value appropriately. -
Example:
dtoverlay=fly-tft-v2,speed=80000000
-
r0/r90/r180/r270
[optional][no parameter required]: Set the display and touch direction of the TFT. Default is 90 degrees. Possible values are 0, 90, 180, 270 (only one configuration can be added). -
Example:
dtoverlay=fly-tft-v2,r90
ordtoverlay=fly-tft-v2,r180
-
disable_touch
[no parameter required]: Disable the touch function of the TFT. Default is enabled. -
Example:
dtoverlay=fly-tft-v2,disable_touch
-
invx
,invy
[no parameter required]: Set the touch direction of the TFT.invx
flips the X direction,invy
flips the Y direction. -
Example:
dtoverlay=fly-tft-v2,invx
ordtoverlay=fly-tft-v2,invy
ordtoverlay=fly-tft-v2,invx,invy
-
swapxy
[no parameter required]: Set the touch direction of the TFT. Swap the X and Y axes, i.e., rotate the screen horizontally.- Example:
dtoverlay=fly-tft-v2,swapxy
- Example:
Note: Multiple parameters can be set simultaneously (optional parameters can only select one). Multiple parameters should be separated by commas and can only be set on one line.
Warning: Normally, only
r0
,r90
,r180
,r270
parameters are used. Other parameters are only used in special cases, especiallyinvx
,invy
,swapxy
.
- Example:
dtoverlay=fly-tft-v2,speed=80000000,r270