|
Edited by DoubleHP at 2019-4-27 20:21
So ... tried https://github.com/Tomasz-Mankowski/ADS7846-X11-daemon . I had various issues with kernels 3.4.113, so now tring on kernel 4.
- # cat /etc/armbian-release
- # PLEASE DO NOT EDIT THIS FILE
- BOARD=orangepizero
- BOARD_NAME="Orange Pi Zero"
- VERSION=5.35
- LINUXFAMILY=sunxi
- BRANCH=next
- ARCH=arm
- IMAGE_TYPE=user-built
- BOARD_TYPE=conf
- INITRD_ARCH=arm
- KERNEL_IMAGE_TYPE=zImage
- # uname -a
- Linux MyHost 4.13.16-sunxi #20 SMP Fri Nov 24 19:50:07 CET 2017 armv7l armv7l armv7l GNU/Linux
- # cat /boot/armbianEnv.txt
- verbosity=1
- logo=disabled
- console=both
- disp_mode=1920x1080p60
- overlay_prefix=sun8i-h3
- overlays=pwm spi-jedec-nor spi-spidev uart1 usbhost2 usbhost3
- param_spidev_spi_bus=1
- param_spidev_max_freq=100000000
- rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
- rootfstype=ext4
- usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
- # file -s /dev/spidev1.0
- /dev/spidev1.0: ERROR: cannot read `/dev/spidev1.0' (Message too long)
- # cat /etc/modules
- g_serial
Copy code
so ... on this machine, spidev node exists.
A machine that does not have LCD.
An other opi0 with LCD:
- reboot
- # cat /boot/armbianEnv.txt
- verbosity=1
- logo=disabled
- console=both
- disp_mode=1920x1080p60
- overlay_prefix=sun8i-h3
- overlays=usbhost2 usbhost3 uart1 spi-spidev pwm spi-jedec-nor
- # spi-jedec-nor
- param_spidev_spi_bus=1
- param_spidev_max_freq=100000000
- rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
- rootfstype=ext4
- user_overlays=myili9431
- usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
- # file -s /dev/spidev1.0
- /dev/spidev1.0: ERROR: cannot read `/dev/spidev1.0' (Message too long)
- # modprobe fbtft_device custom name=fb_ili9486 gpios=dc:18,reset:2 speed=16000000 busnum=1
- # file -s /dev/spidev1.0
- /dev/spidev1.0: cannot open `/dev/spidev1.0' (No such file or directory)
Copy code
This is a huge lead: maybe "spi-spidev pwm spi-jedec-nor" are optionnal in the "overlays" line, but ... "user_overlays=myili9431" does not prevent creating the spidev node. After boot, it does exist. It's modprobe that destroys it, when loading fbtft_device.
While I am here, note that param_spidev_spi_bus=1 is required on opi0 because bus0 is the 4MB flash; the LCD is plugged on the main GPIO which is SPI1. So, don't loose hours playing with spi0, feeling happy that you at last have that file, but cant understand why ./ADS7846-X11 is still unhappy with it. This can be worked around by playing with file name.
Just for the fun, I have tried this:
- # cat /boot/armbianEnv.txt
- verbosity=1
- logo=disabled
- console=both
- disp_mode=1920x1080p60
- overlay_prefix=sun8i-h3
- overlays=usbhost2 usbhost3 uart1 spi-spidev pwm spi-jedec-nor
- # spi-jedec-nor
- param_spidev_spi_bus=0
- param_spidev_max_freq=100000000
- rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
- rootfstype=ext4
- user_overlays=myili9431
- usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
- # file -s /dev/spidev0.0
- /dev/spidev0.0: ERROR: cannot read `/dev/spidev0.0' (Message too long)
- # modprobe fbtft_device custom name=fb_ili9486 gpios=dc:18,reset:2 speed=16000000 busnum=1
- # file -s /dev/spidev0.0
- /dev/spidev0.0: ERROR: cannot read `/dev/spidev0.0' (Message too long)
Copy code
but, this is pointless. It just prooves that the FB driver knows where the LCD is. SPI0 is the right bus for most other opis. For 0s, we want to use SPI1 !!!
I After some tests, I have reduced my /boot/armbianEnv.txt overlays line to "usbhost2 usbhost3 uart1".
Now, lets try the touch layer itself. To be able to play with the thing, we need to:
- NOT modprobe FB
- rename SPI1 into SPI0
- launch X; since it can not have FB, I will try VNC.
I won't give all details; but in short:
- # tightvncserver :0
- # vncviewer localhost:0
- # cd ADS7846-X11-daemon/
- # ./ADS7846-X11 --cal
- ./ADS7846-X11: Error connecting to SPI dev: /dev/spidev0.0
- All closed...
- # cd /dev/
- # ls -lha spi*
- crw------- 1 root root 153, 0 Apr 27 13:38 spidev1.0
- # ln -s spidev1.0 spidev0.0
- # cd /root/ADS7846-X11-daemon/
- # ./ADS7846-X11 --cal
- ./ADS7846-X11: Calibrating...
- Calibration time exceeded
- All closed...
Copy code
I have tried to wait 5s and 1mn before touching the LCD; each time, the app have been waiting quietly, asking me to tap on the cross. As soon as I touch the LCD, at any place, I have a 5s decounter, then it closes. So ... the app can not calibrate, BUT, it detects that I tap once. I have no idea about the orientation, resolution, but the app is clearly doing things almost correctly: it feels my touch. Meaning, many things work fine.
Let's try again:
- # tightvncserver -geometry 480x320 :0
- # vncviewer localhost:0
- # ./ADS7846-X11 --cal
- ./ADS7846-X11: Calibrating...
- Calibration time exceeded
- All closed...
Copy code
Not better. I have tried to simultaneously touch LCD and click in VNC, but it's still not happy. Any way, now, we have a lead.
If it had worked, the next step would have been to unsolder the 4MB chip, and wire directly the ADS/XPT chip to bus SPI0. It would probably imply to cut some stripes, because the LCD shares the same MISO/MOSI lines for the ADS/XPT and LCD driver (ILI chip). But, it's the best I can think about, to get a touch screen fully working with a 4.x kernel.
Running out of ideas for today. |
|