please choosego to mobile | Continue to access the PC version
12
Return to list Post new posts
Author: karthik

Orangepi zero + TFT LCD + GUI Desktop

[Copy link]

1

threads

9

posts

81

credits

Registered member

Rank: 2

credits
81
 Author| Published in 2017-8-23 13:05:57 | Show all floors
Hi,
I am using orangepizero with Armbian_5.30_Orangepizero_Ubuntu_xenial_default_3.4.113 ubuntu server image. I have also installed mate desktop environment to enable my desktop on my waveshare 3.2 LCD. Now the issue is my desktop freezes in my LCD couple of minutes after boot.

I have used heatsink with fan, armbianmonitor show operating temp 40-50 deg cel and cpu load when i run any application 30-40%.

I observed one thing  when my desktop freezes in my LCD, i can access my orangepi with vnc as separate session i can perform any task flawlessly without any freeze.

Any help here?

1

threads

9

posts

81

credits

Registered member

Rank: 2

credits
81
 Author| Published in 2017-8-25 14:01:16 | Show all floors
Any suggestions please?

0

threads

1

posts

26

credits

Novice

Rank: 1

credits
26
Published in 2017-12-26 23:13:10 | Show all floors
karthik replied at 2017-7-25 14:53
Hi,

As suggested I have followed the following steps:

Hi, How to configure script.fex?
I have Waveshare 3.5 TFT LCD.
But I don't know which chip used to drive the LCD screen.
Can you give me script.bin which your created.

7

threads

38

posts

181

credits

Registered member

Rank: 2

credits
181
Published in 2018-12-23 02:38:14 | Show all floors
Random tips :
- orange pi zero all have 2 SPI bus: one in the main GPIO port, and one for the flash on the back side. If you don't have the plus model, you can unsolder the FLASH and use the port. FLASH is port 1, so, GPIO is port 1. This is very important when you follow tutorials written for other opis
- before you start following a tutorial, you need to understand which kernel you are using. If the turial is written after jan 2017, and mentions adding an overlay in armbianEnv.txt, then it's for kernel 4; if the tuto is before feb 2018, and does not mention altering armbianEnv.txt for SPI compatibility, author is using kernel 3. This is critical.
- I got adressable LEDs working on both kernels, 3 and 4. Easier on 4.
- SPI LCDs work only on kernel 3; I have spend days on kernel 4, just forget them; drivers exist, but they are broken.
- con2fbmap is required only on kernel 3
- to get X working, you need to create /etc/X11/xorg.conf.d/99-fbturbo.conf
- check your FB number with a command like this: dmesg | grep ili | grep graphics | grep -i fb . I have seen people using 0, 1 and 8.

7

threads

38

posts

181

credits

Registered member

Rank: 2

credits
181
Published in 2019-4-27 18:32:27 | Show all floors
nopnop2002 replied at 2017-7-28 21:47
/dev/spidev0.0 is used in TFT.

OPI is different from RPI, and there is only 1 of SPI.

Nope, half opis have only one SPI, but inparticular, opi0 has TWO SPIs; and some other models have even more (I believe at least one opi has 3).

The SPI in GPIO is SPI1 SPI0 is the one used for the 4MB flash on the back of the board. Most peoploe who don't use this chip can ulsoder it, and gain a secong GPIO. This is very usefull when you want to use a SPI LCD, plus some 1W probes (what is usually impossible to do with most other opis), or 1wire + adressable LEDs.

For now, I am also facing " Error connecting to SPI dev: /dev/spidev0.0". I already solved this in the past, but i forgot how; I may find a solution tonight, when a friend gives me access to the project. Also, note that SPI access is COMPLETELY different between kernels 3 and kernels 4. ADS7846-X11 is said to work with kernels 3.4.112, but I failed to get ADS7846/XPI2046 work on kernel 3.4.113; I am now trying on 4.14.18-sunxi. I will come back when I have more to say.

7

threads

38

posts

181

credits

Registered member

Rank: 2

credits
181
Published in 2019-4-27 20:17:19 | Show all floors
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.

  1. # cat /etc/armbian-release
  2. # PLEASE DO NOT EDIT THIS FILE
  3. BOARD=orangepizero
  4. BOARD_NAME="Orange Pi Zero"
  5. VERSION=5.35
  6. LINUXFAMILY=sunxi
  7. BRANCH=next
  8. ARCH=arm
  9. IMAGE_TYPE=user-built
  10. BOARD_TYPE=conf
  11. INITRD_ARCH=arm
  12. KERNEL_IMAGE_TYPE=zImage

  13. # uname -a
  14. Linux MyHost 4.13.16-sunxi #20 SMP Fri Nov 24 19:50:07 CET 2017 armv7l armv7l armv7l GNU/Linux

  15. # cat /boot/armbianEnv.txt
  16. verbosity=1
  17. logo=disabled
  18. console=both
  19. disp_mode=1920x1080p60
  20. overlay_prefix=sun8i-h3
  21. overlays=pwm spi-jedec-nor spi-spidev uart1 usbhost2 usbhost3
  22. param_spidev_spi_bus=1
  23. param_spidev_max_freq=100000000
  24. rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
  25. rootfstype=ext4

  26. usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

  27. # file -s /dev/spidev1.0
  28. /dev/spidev1.0: ERROR: cannot read `/dev/spidev1.0' (Message too long)

  29. # cat /etc/modules
  30. g_serial
Copy code


so ... on this machine, spidev node exists.

A machine that does not have LCD.

An other opi0 with LCD:

  1. reboot
  2. #  cat /boot/armbianEnv.txt
  3. verbosity=1
  4. logo=disabled
  5. console=both
  6. disp_mode=1920x1080p60
  7. overlay_prefix=sun8i-h3
  8. overlays=usbhost2 usbhost3 uart1 spi-spidev pwm spi-jedec-nor
  9. # spi-jedec-nor
  10. param_spidev_spi_bus=1
  11. param_spidev_max_freq=100000000
  12. rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
  13. rootfstype=ext4
  14. user_overlays=myili9431
  15. usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
  16. # file -s /dev/spidev1.0
  17. /dev/spidev1.0: ERROR: cannot read `/dev/spidev1.0' (Message too long)
  18. # modprobe fbtft_device custom name=fb_ili9486 gpios=dc:18,reset:2 speed=16000000 busnum=1
  19. # file -s /dev/spidev1.0
  20. /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:
  1. # cat /boot/armbianEnv.txt
  2. verbosity=1
  3. logo=disabled
  4. console=both
  5. disp_mode=1920x1080p60
  6. overlay_prefix=sun8i-h3
  7. overlays=usbhost2 usbhost3 uart1 spi-spidev pwm spi-jedec-nor
  8. # spi-jedec-nor
  9. param_spidev_spi_bus=0
  10. param_spidev_max_freq=100000000
  11. rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
  12. rootfstype=ext4
  13. user_overlays=myili9431
  14. usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
  15. # file -s /dev/spidev0.0
  16. /dev/spidev0.0: ERROR: cannot read `/dev/spidev0.0' (Message too long)
  17. # modprobe fbtft_device custom name=fb_ili9486 gpios=dc:18,reset:2 speed=16000000 busnum=1
  18. # file -s /dev/spidev0.0
  19. /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:
  1. # tightvncserver :0
  2. # vncviewer localhost:0
  3. # cd ADS7846-X11-daemon/
  4. # ./ADS7846-X11 --cal
  5. ./ADS7846-X11: Error connecting to SPI dev: /dev/spidev0.0
  6. All closed...
  7. # cd /dev/
  8. # ls -lha spi*
  9. crw------- 1 root root 153, 0 Apr 27 13:38 spidev1.0
  10. # ln -s spidev1.0 spidev0.0
  11. # cd /root/ADS7846-X11-daemon/
  12. # ./ADS7846-X11 --cal
  13. ./ADS7846-X11: Calibrating...

  14. Calibration time exceeded
  15. 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:

  1. # tightvncserver -geometry 480x320 :0
  2. # vncviewer localhost:0
  3. # ./ADS7846-X11 --cal
  4. ./ADS7846-X11: Calibrating...

  5. Calibration time exceeded
  6. 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.
12
Return to list Post new posts
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list