Template:S5Pxx18-SPI-2.8TFT

From FriendlyELEC WiKi
Revision as of 09:35, 14 December 2017 by Tzs (Talk | contribs) (Created page with "===Under S5P4418 & Linux-3.4 Kernel=== Note: the following method only applies for the Matrix-2'8_SPI_Key_TFT-1512 model. To test a Matrix-2'8_SPI_Key_TFT-1706(silkscreen T28-...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1 Under S5P4418 & Linux-3.4 Kernel

Note: the following method only applies for the Matrix-2'8_SPI_Key_TFT-1512 model. To test a Matrix-2'8_SPI_Key_TFT-1706(silkscreen T28-02 1706) you need to make changes in the S5P4418's kernel file /drivers/char/matrix_ads7846.c.

1.1 Run Qt Programs on Ubuntu-Core

FriendlyElec's Ubuntu-Core supports Qt. Users can run a Qt application by following the steps below.
Boot Ubuntu-Core on a board and clone the Matrix code samples:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

After it is done a "matrix" directory will be generated.

Compile and Run Qt Test Program:

cd matrix/demo/nanopi-status
./build.sh
./run.sh /dev/fb-st7789s

The nanopi-status is a simple Qt program which shows system information. Here is what you expect to observe:
st7789s-status
The run.sh script will load TFT's driver and run the Qt program. After the driver is successfully loaded a device node /dev/fb-st7789s will be generated. You can check whether or not the driver is loaded successfully by running the following commands

lsmod
Module                  Size  Used by
fbtft_device           29235  0

After the TFT's driver is loaded you can enable the TFT by running the following commands

cd matrix/demo/matrix-lcdtest
make
export LCDSET_FB_DEV=/dev/fb-st7789s
./matrix-lcdtest

You will watch the display.

1.2 Display Debian GUI on 2.8"LCD

Boot your ARM board with Debian and and launch the Debian GUI by running the following commands:
After Debian is loaded clone the matrix code samples:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

After it is done a "matrix" directory will be generated.

For H3 based boards you need to change the X11 configuration file as follows:

$ vi /etc/X11/xorg.conf

Change "/dev/fb0" to "/dev/fb-st7789s".

Launch the Debian GUI by running the following commands:

$ cd matrix/demo/nanopi-status/
$ ./display-debian.sh /dev/fb-st7789s

Calibrate the screen by following the four points' movement:
fbtft-debian

After calibration is done you will see the following system information:

Section "InputClass" 
        Identifier      "calibration" 
        MatchProduct    "ADS7846 Touchscreen" 
        Option  "Calibration"   "196 3825 3887 358" 
        Option  "SwapAxes"      "0" 
EndSection

Copy and paste the information to the "/usr/share/X11/xorg.conf.d/99-calibration.conf" file, save it and this will be used as your calibration data when you reboot your board.