1 1
groix

Orange Pi Zero Plus - 3.5 tft lcd screen via SPI

Recommended Posts

I'm trying, with no success, to make a 3,5 inch tft lcd screen function with an orange pi zero plus (h5) via SPI. I will love if someone could help me diagnose the reason why I'm failing in doing so.

 

The screen in question is a WaveShare knockoff -> link (the pinout can be found at the bottom of the page.)

 

I'm running Armbian buster 5.92 with the kernel 4.19.63 and all packages upgraded. I also have a working serial connection (using the UART pins located next to Ethernet jack on the board) and am using the 'screen' program to communicate with the device.

 

When connecting the screen and turning on the board the leds on the screen turns on and the display turns a bright white. The display remains this way no matter what I do.

 

My goal is to make the console output to the screen. There is also a 'touch functionality' incorporated, but for me it is secondary.

 

Here is my process so far trying to make the screen work

 

After reading a lot of forum posts for cases similar to mine (but all referring to the zero (h3) board and to a different Armbian/Kernel versions than mine - and also producing different results), I tried to:

 

Activate the 'SPI overlays' needed by editing the /boot/armbianEnv.txt file according to this documentation (I also changed the 'verbosity' parameter to '7' and the 'console' parameter to 'both')

overlays=spi-spidev spi-add-cs1
param_spidev_spi_bus=1
param_spidev_spi_cs=1

 

After rebooting this appear to activate the SPI1 with CS1 as expected

 

$ ls /dev/spi*
/dev/spidev1.1
$ sudo dmesg | grep spi
[    2.691646] m25p80 spi0.0: mx25l1606e (2048 Kbytes)
[    4.399025] spidev spi1.1: probing from DT

Then I tried to activate and configure the fbtft_device module, that supposedly supports my screen, by creating

/etc/modules-load.d/fbtft.conf

 

and adding  this two lines:

fbtft
fbtft_device

and also

 /etc/modprobe.d/fbtft.conf with this configuration

 

options fbtft_device rotate=90 name=piscreen speed=16000000 busnum=1 gpios=reset:2,dc:18 txbuflen=32768 fps=25

Extracted from here

After rebooting, again, a new framebuffer device is created

$ ls /dev/fb*
/dev/fb0

But the screen remains white, with no alteration.

 

In dmesg I can see that SPI1 failed to transfer data and that the fbtft_device is trying to use spi1.0

$ sudo dmesg | grep -i 'fb\|spi'

[    4.391749] spidev spi1.1: probing from DT
[    6.893332] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    6.935810] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[    6.953422] m25p80 spi0.0: mx25l1606e spi0.0 40000kHz 8 bits mode=0x00
[    6.960055] spidev spi1.1: spidev spi1.1 1000kHz 8 bits mode=0x00
[    6.966595] fbtft_device: GPIOS used by 'piscreen':
[    6.971556] fbtft_device: 'reset' = GPIO2
[    6.971561] fbtft_device: 'dc' = GPIO18
[    6.971577] m25p80 spi0.0: mx25l1606e spi0.0 40000kHz 8 bits mode=0x00
[    6.986087] spidev spi1.1: spidev spi1.1 1000kHz 8 bits mode=0x00
[    6.986099] spi spi1.0: fb_ili9486 spi1.0 16000kHz 8 bits mode=0x00
[    7.858552] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned.
[    9.100443] graphics fb0: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=25, spi1.0 at 16 MHz
[   13.227056] spi_master spi1: spi1.0: timeout transferring 32768 bytes@16000000Hz for 104(100)ms
[   13.227378] fb_ili9486 spi1.0: SPI transfer failed: -110
[   13.227914] spi_master spi1: failed to transfer one message from queue
[   13.228159] fb_ili9486 spi1.0: fbtft_update_display: write_vmem failed to update display buffer
[   13.341870] spi_master spi1: spi1.0: timeout transferring 2 bytes@16000000Hz for 104(100)ms
[   13.341887] fb_ili9486 spi1.0: SPI transfer failed: -110
[   13.341907] spi_master spi1: failed to transfer one message from queue
[   13.341917] fb_ili9486 spi1.0: write() failed and returned -110
[   13.445850] spi_master spi1: spi1.0: timeout transferring 2 bytes@16000000Hz for 104(100)ms
[   13.445864] fb_ili9486 spi1.0: SPI transfer failed: -110
[   13.445886] spi_master spi1: failed to transfer one message from queue
[   13.445896] fb_ili9486 spi1.0: write() failed and returned -110
[   13.556038] spi_master spi1: spi1.0: timeout transferring 2 bytes@16000000Hz for 108(100)ms
[   13.556337] fb_ili9486 spi1.0: SPI transfer failed: -110
[   13.556808] spi_master spi1: failed to transfer one message from queue
[   13.557056] fb_ili9486 spi1.0: write() failed and returned -110


So, according with this fbtft_device documentation I changed /etc/modprobe.d/fbtft.conf to include cs=1 to see if the module would 'use' spi1.1

options fbtft_device rotate=90 name=piscreen speed=16000000 busnum=1 cs=1 gpios=reset:2,dc:18 txbuflen=32768 fps=25

After rebooting, the screen remains white and now dmesg is showing this:
 

$ sudo dmesg | grep -i 'fb\|spi'

[    4.392284] spidev spi1.1: probing from DT
[    6.955069] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    6.997515] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[    7.009650] m25p80 spi0.0: mx25l1606e spi0.0 40000kHz 8 bits mode=0x00
[    7.016383] spidev spi1.1: spidev spi1.1 1000kHz 8 bits mode=0x00
[    7.016474] spidev spi1.1: Deleting spi1.1
[    7.027482] fbtft_device: GPIOS used by 'piscreen':
[    7.032449] fbtft_device: 'reset' = GPIO2
[    7.036490] fbtft_device: 'dc' = GPIO18
[    7.040409] m25p80 spi0.0: mx25l1606e spi0.0 40000kHz 8 bits mode=0x00
[    7.047052] spi spi1.1: fb_ili9486 spi1.1 16000kHz 8 bits mode=0x00
[    7.723075] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned.
[    8.614341] graphics fb0: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=25, spi1.1 at 16 MHz
[    9.125884] spi_master spi1: spi1.1: timeout transferring 32768 bytes@16000000Hz for 104(100)ms
[    9.136951] fb_ili9486 spi1.1: SPI transfer failed: -110
[    9.143527] spi_master spi1: failed to transfer one message from queue
[    9.161691] fb_ili9486 spi1.1: fbtft_update_display: write_vmem failed to update display buffer


Now it appears that spi1.1 is been deleted and in fact it is not present in /dev/

 $ ls /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory


Now I am stuck. Can someone help me understand and diagnose what is happening?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1