

GusAntoniassi
-
Posts
6 -
Joined
-
Last visited
Reputation Activity
-
GusAntoniassi reacted to chwe in [Solved] Cannot make 3.5" TFT Screen touch work on Orange Pi PC (Mainline Kernel)
okay, I try to explain the situation a little bit.. Armbian has 3 different kernels for most SBCs we provide images. Legacy (which is for the H3 board the 3.4.113 BSP kernel), next (kernel from kernel.org currently pinned to 4.14.y) and dev (kernel from kernel.org currently pinned to 4.16.y).
On the normal downloadpage the maintainers provide images which are suggested for a different use-case. One of the main reasons why we suggest the legacy kernel for desktop usage is that it has hardware acceleration (e.g. when you use the MPV player, videodecoding happens on the VPU not CPU). In case you only use CLI and no desktop, video acceleration is mostly of minor interest therefore a more recent kernel might be more important than hardware acceleration therefore we often suggest to use the mainline kernel.
For example the 3.4 kernel is to old to build debian stretch images, but with the mainline kernel stretch images are possible (and you get the newer packages of some libraries provided by debian stretch).
3.4 Kernel is EOL since a while and doesn't get updates anymore whereas 4.14 should get update at least until 2020. As soon as hardware acceleration is possible with the mainline kernel (see Bootlin mainlining the VPU), legacy images based on Allwinners BSP kernel might get dropped and Armbian will only provide images based on mainline. The reason why there are also legacy CLI images available is due to hardware which do not work at the moment (e.g. the camera interface is not supported by mainline yet).
You can also use mainline images with a desktop but you won't have any hardware accelerated videodecoding capabilities and therefore playing videos will be painful, and might only work on low resolution if at all.
If you download a mainline image you get this warnig:
Cause we can't test everything for all the boards and every use-case armbian users think about, there might be bugs which we didn't found or which are not solved yet. The BSP kernel is better known and therefore devs know most of it's limitations. For mainline, we rely mostly on upstream plus a 'few' (for Sunxi boards this means ~100 ) patches to fix things which aren't mainlined (yet). With every kernelupdate those patches can break things or can get obsolete cause they're no longer needed, you can imaging that this can't be tested for every board and every use case (e.g only for H3, we provide stable images for 15 different boards).
Depending on what you want to do on your display, you might not need hardware acceleration that much and mainline is fine for you. Test it and find out if it works well for you.
-
GusAntoniassi reacted to chwe in [Solved] Cannot make 3.5" TFT Screen touch work on Orange Pi PC (Mainline Kernel)
is based on Allwinners BSP kernel and therefore not mainline. Images based on mainline kernel is for example the right on the downloapage (Debian server – mainline kernel) or the ones under the 'other download options and archive' section called next or dev (whereas the nightly images are mostly untested and therefore only recommended for testing and not production use-cases). You might change the topic name as long as you use a legacy image.
from the tutorials you linked to:
I don't know if this statement is still correct or if there's a workaround for it but can this be an issue? The second tutorial you linked is about a HDMI display and from what I saw, yours is a SPI one so this tutorial might be not that useful for you.
From what I saw you need to proper defined CS pins (one for the touchscreen one for the display). Are you sure that those pins are properly defined? It's more a generic answer since I haven't this display to test it. Maybe @yam1 a bit more precise can help you, since he did a lot of display stuff :
-
GusAntoniassi reacted to chwe in [Solved] Cannot make 3.5" TFT Screen touch work on Orange Pi PC (Mainline Kernel)
is not mainline.. that's the old legacy kernel.
you might need to know which driver is needed for your display.. and which touchdriver...
-
GusAntoniassi reacted to kutysam in Guide: How to use Touchscreen + LCD on H3 devices
FAQ / Personal Experiences
Q1) If you wish to do manual testing, without rebooting, we have to rmmod and then modprobe manually [Make sure you have already done all the steps till depmod
sudo rmmod fbtft_device sudo rmmod fbtft sudo rmmod ads7846_device sudo rmmod ads7846 sudo modprobe ads7846 sudo modprobe ads7846_device model=7846 cs=1 gpio_pendown=1 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900 sudo modprobe fbtft sudo modprobe fbtft_device rotate=90 name=piscreen speed=16000000 gpios=reset:2,dc:71 txbuflen=32768 fps=25
Q2) My mainline kernel suddenly doesn't show me that my device is touchable through evtest. I experienced this and i did the following
Remove all on boot loading for ads7846 and fbtft
sudo rm /etc/modules-load.d/ads7846.conf sudo rm /etc/modprobe.d/ads7846_device.conf sudo rm /etc/modprobe.d/fbtft.conf sudo rm /etc/modules-load.d/fbtft.conf After which, lets manually 'automatically' load them through rc.local
nano /etc/rc.local modprobe ads7846 modprobe ads7846_device model=7846 cs=1 gpio_pendown=1 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900 modprobe fbtft modprobe fbtft_device rotate=90 name=piscreen speed=16000000 gpios=reset:2,dc:71 txbuflen=32768 fps=25 con2fbmap 1 0 Take note that con2fbmap is either 1 0 or 1 1 for mainline (1 0 --> orange pi lite or devices without AVOUT, 1 1 --> for devices with AVOUT like orange pi zero)
For advanced users, check /dev/ and see what is your fbX
Q3) I have installed a GUI for my mainline kernel but touch stops at times.
I experience this too and I have no idea on how to fix it.
Q4) I need to calibrate it
Yes, me too. However, my device isn't working very well. You need tslib and stuff to do the calibration.
-
GusAntoniassi reacted to kutysam in Guide: How to use Touchscreen + LCD on H3 devices
Mainline Kernel [You can use BOTH LCD and TOUCH]
1) Enable overlays for spi and cs1
sudo nano /boot/armbianEnv.txt add the following to the bottom overlays=spi-spidev spi-add-cs1 param_spidev_spi_bus=0 param_spidev_spi_cs=1 2) Reboot your device
LCD
1) Load fbtft and fbtft_device on boot
sudo nano /etc/modules-load.d/fbtft.conf fbtft fbtft_device 2) Load fbtft_device options
nano /etc/modprobe.d/fbtft.conf options fbtft_device rotate=90 name=piscreen speed=16000000 gpios=reset:2,dc:71 txbuflen=32768 fps=25 3) Since there is no GUI in mainline, lets enable the console to be displayed to LCD instead
sudo nano /etc/rc.local con2fbmap 1 1 For some others, you may wish to try con2fbmap 1 0 [If your device has no AVout]
4) Reboot your device (sudo reboot) and you screen should be lit up
===========================================================================
TOUCH
1) Download ads7846 touch driver (compatible with xpt2046)
mkdir ds7846 cd ds7846 wget https://sourceforge.net/p/openipmi/linux-ipmi/ci/master/tree/drivers/input/touchscreen/ads7846.c?format=raw mv ads7846.c?format=raw ads7846.c 2) Create a makefile (Take note that it is TABS instead of spaces before the $(MAKE))
nano Makefile Insert the below in without the ----- -------------------------------- obj-m := ads7846.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean install: $(MAKE) -C $(KDIR) M=$(PWD) modules_install -------------------------------- 3) Exit nano and run the following
sudo make sudo make install sudo depmod 4) Download and compile and install ads7846_device
cd .. git clone https://github.com/notro/fbtft_tools/ cd fbtft_tools/ads7846_device make sudo make install sudo depmod 5) Load ads7846 and ads7846_device on boot
sudo nano /etc/modules-load.d/ads7846.conf ads7846 ads7846_device 6) Load ads7846_device options
nano /etc/modprobe.d/ads7846_device.conf options ads7846_device model=7846 cs=1 gpio_pendown=1 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900
-
GusAntoniassi reacted to kutysam in Guide: How to use Touchscreen + LCD on H3 devices
First of all, credits goes to https://4pda.ru/forum/lofiversion/index.php?t750921-2560.html
Device that I used for this guide: https://www.aliexpress.com/item/3-5-Inch-TFT-LCD-Moudle-For-Raspberry-Pi-2-Model-B-RPI-B-raspberry-pi/32707058182.html
Pinout: http://www.waveshare.com/3.5inch-rpi-lcd-a.htm (Yes, the device is a waveshare knockoff)
How to place the device? For Orange pi lite/one it is reversed. For the rest, it should be normal.
Refer to https://forum.armbian.com/index.php?/topic/724-quick-review-of-orange-pi-one/ for more info.
There are two sections to this guide.
Legacy / Mainline
Legacy Kernel [You can only EITHER use touch or LCD due to issues with spi chip select]
LCD
1) Load fbtft and fbtft_device on boot
sudo nano /etc/modules-load.d/fbtft.conf fbtft fbtft_device
2) Load fbtft_device options
nano /etc/modprobe.d/fbtft.conf options fbtft_device rotate=90 name=piscreen speed=16000000 gpios=reset:2,dc:71 txbuflen=32768 fps=25
3) Make sure X11 loads to the correct framebuffer (fb8 for legacy)
nano /etc/X11/xorg.conf.d/50-fbturbo.conf find fb0 and change to fb8
4) Reboot your device (sudo reboot) and you screen should be lit up
============================================
TOUCH
1) Download ads7846 touch driver (compatible with xpt2046)
mkdir ds7846 cd ds7846 wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-3.6.y/drivers/input/touchscreen/ads7846.c
2) Create a makefile (Take note that it is TABS instead of spaces before the $(MAKE))
nano Makefile Insert the below in without the ----- -------------------------------- obj-m := ads7846.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean install: $(MAKE) -C $(KDIR) M=$(PWD) modules_install --------------------------------
3) Exit nano and run the following
sudo make sudo make install sudo depmod
4) Download and compile and install ads7846_device
cd .. git clone https://github.com/notro/fbtft_tools/ cd fbtft_tools/ads7846_device make sudo make install sudo depmod
5) Load ads7846 and ads7846_device on boot
sudo nano /etc/modules-load.d/ads7846.conf ads7846 ads7846_device
6) Load ads7846_device options
nano /etc/modprobe.d/ads7846_device.conf options ads7846_device model=7846 cs=0 gpio_pendown=1 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900
7) Reboot your device and run evtest
sudo reboot sudo evtest Find your touch device and happy touching. Every touch should generate an event.