Jump to content

any clues for the creation of a dtoverlay for fbtft on 5.4.y?


Recommended Posts

Posted

I am trying to figure out how to create a dtoverlay to allow my waveshare 2.8a fbtft screen to work. 

 

I understand that i the 5.x.y kernels, a dtoverlay is required. 

 

I'm starting with the waveshare32b.dts for raspberry pi, found here: 

https://github.com/swkim01/waveshare-dtoverlays

 

Should be compatible with the 2.8a per waveshare wiki. 

 

I'm trying to modify it in sort of the same way as was done in this thread, for another display: 

 

The board I'm using for this is an orangepi pc2. 

 

But i don't' actually know what I'm doing. What I've come up with so far is this: 

 

/*
 * Device Tree overlay for waveshare 3.2inch B and 2.8inch A TFT LCD
 *
 */

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun8i-h3", "allwinner,sun50i-h5";

        fragment@0 {
                target = <&spi1>;
                __overlay__ {
                        status = "okay";

                        spidev@0{
                                status = "disabled";
                        };

                        spidev@1{
                                status = "disabled";
                        };
                };
        };

        fragment@1 {
                target = <&pio>;
                __overlay__ {
                        waveshare32b_pins: waveshare32b_pins {
                                allwinner,pins = "pa1", "pa0", "pa3" ;
                                allwinner,function = "gpio_in";
                        };
                };
        };

        fragment@2 {
                target = <&spi1>;
                __overlay__ {
                        /* needed to avoid dtc warning */
                        #address-cells = <1>;
                        #size-cells = <0>;

                        waveshare32b: waveshare32b@0{
                                compatible = "ilitek,ili9340";
                                reg = <0>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&waveshare32b_pins>;

                                spi-max-frequency = <16000000>;
                                txbuflen = <32768>;
                                rotate = <90>;
                                fps = <25>;
                                bgr = <0>;
                                buswidth = <8>;
                                reset-gpios = <&pio 0 0 0>;
                                dc-gpios = <&pio 0 3 0>;
                                debug = <0>;
                        };

                        waveshare32b_ts: waveshare32b-ts@1 {
                                compatible = "ti,ads7846";
                                reg = <1>;

                                spi-max-frequency = <2000000>;
                                interrupts = <17 2>; /* high-to-low edge triggered */
                                interrupt-parent = <&gpio>;
                                pendown-gpio = <&pio 0 1 0>;
                                ti,x-plate-ohms = /bits/ 16 <60>;
                                ti,pressure-max = /bits/ 16 <255>;
                        };
                };
        };

        __overrides__ {
                speed =         <&waveshare32b>,"spi-max-frequency:0";
                txbuflen =      <&waveshare32b>,"txbuflen:0";
                rotate =        <&waveshare32b>,"rotate:0";
                fps =           <&waveshare32b>,"fps:0";
                bgr =           <&waveshare32b>,"bgr:0";
                debug =         <&waveshare32b>,"debug:0";
                swapxy =        <&waveshare32b_ts>,"ti,swap-xy?";
        };
};

There are no errors from armbian-add-overlay, but when i reboot the screen is not working, fbtft is not loaded, and i see no messages in dmesg that look like they relate to my efforts. 

So, any clues? Does anything jump out as being wrong? 

Posted
5 hours ago, martinayotte said:

Did you look more thoroughly in "dmesg", maybe there something else missing ...

 

Yeah, nothing that looks like it is directly related. 

 

the only mention of spi is where it complains about not being able to create a device for spi flash that might not exist. 

 

During the uboot part of bootup it complains about no boot.env and that might be related. Maybe it's not reading armbianEnv.txt at all? I think i might hook up the serial console so i can log the whole boot process. 

Posted

OK, this is probably related: 

 

Quote

Applying user provided DT overlay waveshare_32b_28a_opi.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
Error applying DT overlays, restoring original DT


 

Is there a way to get a more informative error message? 

Posted
55 minutes ago, ej0rge said:

Applying user provided DT overlay waveshare_32b_28a_opi.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
Error applying DT overlays, restoring original DT

Yes, this is an important error, it mean that some parameters inside overlay are not resolved !

57 minutes ago, ej0rge said:

Is there a way to get a more informative error message?

Unfortunately, there is no way to get it more verbose during that boot phase.

But, it is a bit easier to debug using dynamic loading :

mkdir /sys/kernel/config/device-tree/overlays/waveshare
cat waveshare.dtbo > /sys/kernel/config/device-tree/overlays/wave/dtbo

Then, "dmesg" reveal a more verbose "OF: resolver: overlay phandle fixup failed: -22" .

It is probably that the line "interrupt-parent = <&gpio>;" should be "interrupt-parent = <&pio>;" instead ...

Posted
22 minutes ago, martinayotte said:

Yes, this is an important error, it mean that some parameters inside overlay are not resolved !

Unfortunately, there is no way to get it more verbose during that boot phase.

But, it is a bit easier to debug using dynamic loading :


mkdir /sys/kernel/config/device-tree/overlays/waveshare
cat waveshare.dtbo > /sys/kernel/config/device-tree/overlays/wave/dtbo

Then, "dmesg" reveal a more verbose "OF: resolver: overlay phandle fixup failed: -22" .

It is probably that the line "interrupt-parent = <&gpio>;" should be "interrupt-parent = <&pio>;" instead ...

 

Thanks for that. - i was unsure about whether that line needed to change. 

 

It loads now, but the screen is still white, so i guess i have more troubleshooting to do. 

 

The touch device also is not working. 

[    8.040102] ads7846: probe of spi1.1 failed with error -22
[    8.041249] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    8.060153] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[    8.062524] fbtft_of_value: buswidth = 8
[    8.062534] fbtft_of_value: debug = 0
[    8.062537] fbtft_of_value: rotate = 90
[    8.062539] fbtft_of_value: fps = 25
[    8.062542] fbtft_of_value: txbuflen = 32768
 

I should clarify, while I'm not a programmer, I have been using linux for roughly as long as it has existed, and in a previous life i worked for a now-long-dead embedded linux vendor in QA. But that was almost 20 years ago and if i knew anything about uboot at the time i have forgotten it. I am also not sure device trees were a thing in 2001. 

 

Maybe i should say, as far as my embedded hacking skills are concerned, I have yet to find if there is anything under the rust. 

Posted

Got it.  TFT at least. reset_gpios needed to be 0 0 1 instead of 0 0 0. Yes i should really find where the referece is for what the syntax means instead of trying to intuit it. 

 

I'll see if i can tease the touch into working though i don't really need it for my application.  Edit: probably gonna start with copypasta from this but with the correct gpio pins: https://github.com/armbian/sunxi-DT-overlays/blob/master/examples/spi-ads7846.dts

 

So far I have only tested this on my orange pi pc2 running 5.4.20

 

 

20200303_151349.jpg

waveshare_32b_28a_opi.dts

Posted

I have the waveshare 2.8 A tft and touch panel working on the Orange Pi PC2 with one long dtoverlay. 

 

Some of my inspiration came from here: 

 

Like i said one dtoverlay, both fbtft and the touch panel, no other overlays needed. 

 

I admit i am a neophyte and it might be possible to trim this one slightly and use it in combination with the CS1 dtoverlay but it wasn't clear to me how that would work. 

 

I am using a 6 inch hand-made cable to connect my waveshare 2.8 A but it is wired straight through on only the needed wires for touch and tft. 

 

As I've said before it should work just the same with a 3.2 B. 

 

May work on PC Prime as-is, should work on other orange pi boards with minor changes (compatible arch and the assignment of pin 26 varies from board to board).

For orange pi zero, zero plus (H3 and H5), maybe some others, instances of PA21 should be changed to PA10. Check your pinouts to be sure. 

 

The spi speed of 1.6mhz for the tft is a safe example, I have run up to 4mhz without issues and might be able to go higher but i am leaving the safe default in place for this post.

 

one caveat: as i said i don't have a use for the touch panel in my application. I tested it by catting /dev/input/mouse1 and running a fingernail over the touch panel. I got output. yay. More tweaks might be needed, but the driver is fundamentally working and all the overrides are included in the dts

 

waveshare_32b_28a_opipc2.dts

Posted

With small changes it also works with Orange Pi Plus 2e, pin names are the same and only thing that needs to be changed is find/replace spi1 to spi0

Posted

Hi, I was trying to adapt a similar DT overlay for a waveshare 3.5 TFT touchscreen clone, but when I try to add the overlay it gives me the next errors:

 

Compiling the overlay
tft35a-overlay.dts:6.13-20.4: ERROR (phandle_references): /fragment@0: Reference to non-existent node or label "spi1"

tft35a-overlay.dts:22.13-32.4: ERROR (phandle_references): /fragment@1: Reference to non-existent node or label "pio"

tft35a-overlay.dts:34.13-68.4: ERROR (phandle_references): /fragment@2: Reference to non-existent node or label "spi1"

tft35a-overlay.dts:41.21-55.6: ERROR (phandle_references): /fragment@2/__overlay__/tft35a@0: Reference to non-existent node or label "pio"

tft35a-overlay.dts:41.21-55.6: ERROR (phandle_references): /fragment@2/__overlay__/tft35a@0: Reference to non-existent node or label "pio"

tft35a-overlay.dts:57.27-66.6: ERROR (phandle_references): /fragment@2/__overlay__/tft35a-ts@1: Reference to non-existent node or label "pio"

tft35a-overlay.dts:57.27-66.6: ERROR (phandle_references): /fragment@2/__overlay__/tft35a-ts@1: Reference to non-existent node or label "pio"

ERROR: Input tree has errors, aborting (use -f to force output)
Error compiling the overlay

 

I'm not sure what is wrong in the dts file since the "sunxi-h3-h5.dtsi" in the kernel version I'm using (5.10-rc3) has those names defined. The dts file I'm trying to compile is attached to the post.

tft35a-overlay.dts

Posted
7 hours ago, JORGETECH said:

Ok, I fixed the compilation problem by adding "/plugin/;" under "/dts-v1/;". But the screen is still white, maybe my screen has different pinout?

 

Do you have a serial console? that is the best way to see what is happening during bootup.  At first glance i think some detail may be missing from your dts but right now i don't remember enough of my own troubleshooting process. I will look into it again a little later today though. 

 

Double check the pinout - you didn't mention what board you are on and not all h3 headers are alike. 

 

Also i notice that the raspberry pi overlays for the 3.5 screens, of which there are 3 versions, have an "init" stanza that you might need to copy/paste all or part of. 

 

https://github.com/swkim01/waveshare-dtoverlays

Posted
17 hours ago, ej0rge said:

 

Do you have a serial console? that is the best way to see what is happening during bootup.  At first glance i think some detail may be missing from your dts but right now i don't remember enough of my own troubleshooting process. I will look into it again a little later today though. 

 

Double check the pinout - you didn't mention what board you are on and not all h3 headers are alike. 

 

Also i notice that the raspberry pi overlays for the 3.5 screens, of which there are 3 versions, have an "init" stanza that you might need to copy/paste all or part of. 

 

https://github.com/swkim01/waveshare-dtoverlays

I'm using an Orange Pi PC, I added the init stanza for my screen and change the "PA1 PA0 PA3" pins to "PA1 PA2 PC7" since those are the "TP_IRQ", "RST" and "LCD_RS" pins on my screen. I'm still getting a white screen but there is now an additional framebuffer device "/dev/fb1" which I don't remember being there before, so I'm getting somewhere.

Posted

After some tinkering I disabled the "spi-add-cs1" and "spi-spidev" overlays since they were conflicting with the touchscreen overlay. That still did not fix the problem unfortunately.

 

Here are the relevant outputs of dmesg:

 

  • dmesg | grep tft
[    8.850107] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
  • dmesg | grep spi
[    8.739055] ads7846: probe of spi1.1 failed with error -22
[    8.759803] [drm] Initialized ili9486 1.0.0 20200118 for spi1.0 on minor 2
[    8.762151] ili9486 spi1.0: [drm] fb1: ili9486drmfb frame buffer device

So the touchscreen could have an initialization error, but I'm not too worried about that right now. The odd thing is that the DRM subsystem seems to correctly identify the TFT framebuffer device, but when I try to use it with apps like "fbi" and "con2fbmap" I still get a white screen.

Posted
4 hours ago, JORGETECH said:

After some tinkering I disabled the "spi-add-cs1" and "spi-spidev" overlays since they were conflicting with the touchscreen overlay. That still did not fix the problem unfortunately.

 

Here are the relevant outputs of dmesg:

 

  • dmesg | grep tft

[    8.850107] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
  • dmesg | grep spi

[    8.739055] ads7846: probe of spi1.1 failed with error -22
[    8.759803] [drm] Initialized ili9486 1.0.0 20200118 for spi1.0 on minor 2
[    8.762151] ili9486 spi1.0: [drm] fb1: ili9486drmfb frame buffer device

So the touchscreen could have an initialization error, but I'm not too worried about that right now. The odd thing is that the DRM subsystem seems to correctly identify the TFT framebuffer device, but when I try to use it with apps like "fbi" and "con2fbmap" I still get a white screen.

 

Clearly getting closer. But i gotta point out, there is more information to be seen on the serial console. usb-to-ttl-serial dongles are cheap and plentiful. 

Regretfully it has been several months since i worked on this sort of thing and my memory is foggy.

Posted
22.11.2020 в 23:47, JORGETECH сказал:

After some tinkering I disabled the "spi-add-cs1" and "spi-spidev" overlays since they were conflicting with the touchscreen overlay. That still did not fix the problem unfortunately.

 

Here are the relevant outputs of dmesg:

 

  • dmesg | grep tft

[    8.850107] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
  • dmesg | grep spi

[    8.739055] ads7846: probe of spi1.1 failed with error -22
[    8.759803] [drm] Initialized ili9486 1.0.0 20200118 for spi1.0 on minor 2
[    8.762151] ili9486 spi1.0: [drm] fb1: ili9486drmfb frame buffer device

So the touchscreen could have an initialization error, but I'm not too worried about that right now. The odd thing is that the DRM subsystem seems to correctly identify the TFT framebuffer device, but when I try to use it with apps like "fbi" and "con2fbmap" I still get a white screen.

Try this one https://gist.github.com/olehs/1cd3e5ddf45066380df68a70d6f8462a

You only need spi-add-cs1 overlay enabled

 

Posted

Best source of documentation IMHO is from the armbian source.  These references should provide the needed description to make a usable device tree. They are mirrored here:

The other tidbit of info is the structure of a gpio cell property. AFAIK the numeric values for <&pio 0 2 1> refers to pin group 0 = A, pin offset 2 (A2), and pull-up flag.

 

Also, it is required to configure and activate the device trees. Configuration, like param_spidev_spi_bus=0, is still a mystery to me. armbian-config doesn't automatically add these items to /boot/armbianEnv.txt so this can be a major source of frustration.

 

My example /boot/armbianEnv.txt:

verbosity=7
dtdebug=7
bootlogo=false
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun50i-h5
overlays=spi-spidev
param_spidev_spi_bus=0
user_overlays=sun50i-h5-ili9341
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
rootdev=UUID=8d9edae5-2ab9-4c42-933e-ee4235da815f
rootfstype=ext4

I created sun50i-h5-ili9341 using the referenced documentation as a guide.

Posted
On 12/18/2020 at 1:32 PM, olehs said:

Try this one https://gist.github.com/olehs/1cd3e5ddf45066380df68a70d6f8462a

You only need spi-add-cs1 overlay enabled

 

Thank you I am littlebit close with this!

 

/ _ \|  _ \(_)  / _ \ _ __   ___
| | | | |_) | | | | | | '_ \ / _ \
| |_| |  __/| | | |_| | | | |  __/
 \___/|_|   |_|  \___/|_| |_|\___|

Welcome to Armbian 21.02.1 Focal with Linux 5.10.12-sunxi


downloaded compiled via:

sudo armbian-add-overlay tft35a-overlay.dts



evtest touch screen works! 


I can see fb1 device

root@orangepione:~# ls /dev/fb*

/dev/fb0 /dev/fb1



but screen is still white 



root@orangepione:~# cat /boot/armbianEnv.txt
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=14ec09df-9864-4191-b047-c6bfafc28b7e
rootfstype=ext4
overlays=spi-add-cs1
user_overlays=tft35a-overlay
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u




/etc/X11/xorg.conf.d/99-fbturbo.conf

Section "Device"

Identifier "Allwinner A10/A13 FBDEV"

Driver "fbturbo"

Option "fbdev" "/dev/fb1"

Option "SwapbuffersWait" "true"

EndSection



root@orangepione:~# dmesg | grep touch

[ 7.180180] ads7846 spi0.1: touchscreen, irq 67



root@orangepione:~# dmesg | grep tft

[ 7.220722] fbtft: module is from the staging directory, the quality is unknown, you have been warned.



root@orangepione:~# dmesg | grep spi

[ 7.116782] ads7846 spi0.1: supply vcc not found, using dummy regulator

[ 7.179629] [drm] Initialized ili9486 1.0.0 20200118 for spi0.0 on minor 2

[ 7.180180] ads7846 spi0.1: touchscreen, irq 67

[ 7.180833] input: ADS7846 Touchscreen as /devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.1/input/input1

[ 7.199053] ili9486 spi0.0: [drm] fb1: ili9486drmfb frame buffer device



root@orangepione:~# startx

X.Org X Server 1.20.9

X Protocol Version 11, Revision 0

Build Operating System: Linux 4.15.0-130-generic armv7l Ubuntu

Current Operating System: Linux orangepione 5.10.12-sunxi #21.02.1 SMP Wed Feb 3 20:39:30 CET 2021 armv7l

Kernel command line: root=UUID=14ec09df-9864-4191-b047-c6bfafc28b7e rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 consoleblank=0 loglevel=1 ubootpart=54392a35-01 ubootsource=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1

Build Date: 17 January 2021 09:13:31AM

xorg-server 2:1.20.9-2ubuntu1.2~20.04.1 (For technical support please see http://www.ubuntu.com/support)

Current version of pixman: 0.38.4

Before reporting problems, check http://wiki.x.org

to make sure that you have the latest version.

Markers: (--) probed, (**) from config file, (==) default setting,

(++) from command line, (!!) notice, (II) informational,

(WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(==) Log file: "/var/log/Xorg.0.log", Time: Sat Feb 13 21:28:22 2021

(==) Using config directory: "/etc/X11/xorg.conf.d"

(==) Using system config directory "/usr/share/X11/xorg.conf.d"

MESA-LOADER: failed to open ili9486 (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)

failed to load driver: ili9486

(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.

(II) modeset(G0): Initializing kms color map for depth 16, 6 bpc.

xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

..

 

I think I am close but some detail still missing :(

Posted
On 2/13/2021 at 11:04 PM, olehs said:

@locki, can you install WiringOP and attach the output of


gpio readall

 ?

It was white because i had connected HDMI monitor :D Now can see output on tft :) but i cant startx

root@orangepione:~# startx


X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-130-generic armv7l Ubuntu
Current Operating System: Linux orangepione 5.10.12-sunxi #21.02.1 SMP Wed Feb 3                                                                                                                                  20:39:30 CET 2021 armv7l
Kernel command line: root=UUID=14ec09df-9864-4191-b047-c6bfafc28b7e rootwait roo                                                                                                                                 tfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_ou                                                                                                                                 tput_mode=1920x1080p60 consoleblank=0 loglevel=1 ubootpart=54392a35-01 ubootsour                                                                                                                                 ce=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   sunxi_ve_mem_reserve                                                                                                                                 =0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapacco                                                                                                                                 unt=1
Build Date: 17 January 2021  09:13:31AM
xorg-server 2:1.20.9-2ubuntu1.2~20.04.1 (For technical support please see http:/                                                                                                                                 /www.ubuntu.com/support)
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Feb 14 22:27:50 2021
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
MESA-LOADER: failed to open ili9486 (search paths /usr/lib/arm-linux-gnueabihf/d                                                                                                                                 ri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: ili9486
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
(II) modeset(G0): Initializing kms color map for depth 16, 6 bpc.
xinit: connection to X server lost

waiting for X server to shut down ...(II) Server terminated successfully (0). Cl                                                                                                                                 osing log file.
.
root@orangepione:~#

 

How to fix this driver missing issue? i dint find it ... and also can i rotate screen 180 degrees somehow?

 

I tryded:

 

Option  "SwapAxes"      "1"

 

and

 

Option          "InvertY" "true"
Option          "InvertX" "true"

 

in  /etc/X11/xorg.conf.d/99-fbturbo.conf

 

Posted
12 минут назад, locki сказал:

It was white because i had connected HDMI monitor :D Now can see output on tft :) but i cant startx


root@orangepione:~# startx


X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-130-generic armv7l Ubuntu
Current Operating System: Linux orangepione 5.10.12-sunxi #21.02.1 SMP Wed Feb 3                                                                                                                                  20:39:30 CET 2021 armv7l
Kernel command line: root=UUID=14ec09df-9864-4191-b047-c6bfafc28b7e rootwait roo                                                                                                                                 tfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_ou                                                                                                                                 tput_mode=1920x1080p60 consoleblank=0 loglevel=1 ubootpart=54392a35-01 ubootsour                                                                                                                                 ce=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   sunxi_ve_mem_reserve                                                                                                                                 =0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapacco                                                                                                                                 unt=1
Build Date: 17 January 2021  09:13:31AM
xorg-server 2:1.20.9-2ubuntu1.2~20.04.1 (For technical support please see http:/                                                                                                                                 /www.ubuntu.com/support)
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Feb 14 22:27:50 2021
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
MESA-LOADER: failed to open ili9486 (search paths /usr/lib/arm-linux-gnueabihf/d                                                                                                                                 ri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: ili9486
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
(II) modeset(G0): Initializing kms color map for depth 16, 6 bpc.
xinit: connection to X server lost

waiting for X server to shut down ...(II) Server terminated successfully (0). Cl                                                                                                                                 osing log file.
.
root@orangepione:~#

 

How to fix this driver missing issue? i dint find it ... and also can i rotate screen 180 degrees somehow?

 

I tryded:

 

Option  "SwapAxes"      "1"

 

and

 

Option          "InvertY" "true"
Option          "InvertX" "true"

 

in  /etc/X11/xorg.conf.d/99-fbturbo.conf

 

Not sure, but the problem may be in distro you are using. I'm on Buster, not Focal.

Posted

I have a similar issue with my Orange Pi zero LTS and a waveshare clone. I have worked already several days on the problem but it looks like that I am not able to communicate with the ili9486 over SPI. I think the problem is, that I am somehow still using SPI Bus 0, but I have to use SPI Bus 1.

 

My Device tree overlay looks as follows: 

/dts-v1/;
/plugin/;

/ {
    compatible = "xunlong,orangepi-zero\0allwinner,sun8i-h2-plus";


    fragment@0 {
		target = <&spi1>;

		__overlay__ {
			status = "okay";
            

			
		};
	};
    fragment@1 {
        target = <&pio>;
        
        __overlay__{
            pins: tft35a_pins {
                pins = "PA1\0PA7\0PA19";
                function = "gpio_in";
            };
        };
    };

    fragment@2 {
        target = <&spi1>;

        __overlay__ {
            #address-cells = <0x01>;
			#size-cells = <0x00>;

			disp: tft35a@0 {
				compatible = "ilitek,ili9486";
				reg = <0x00>;
				pinctrl-names = "default";
				pinctrl-0 = <&pins>;
				spi-max-frequency = <16000000>;
				txbuflen = <32768>;
				rotate = <90>;
				bgr = <0>;
				fps = <30>;
				buswidth = <8>;
				regwidth = <16>;
				reset-gpios = <&pio 0x00 0x07 0x01>;
				dc-gpios = <&pio 0x00 0x13 0x00>;
				debug = <0>;
				init = <0x10000f1 0x36 0x04 0x00 0x3c 0x0f 0x8f 0x10000f2 0x18 0xa3 0x12 0x02 0xb2 0x12 0xff 0x10 0x00 0x10000f8 0x21 0x04 0x10000f9 0x00 0x08 0x1000036 0x08 0x10000b4 0x00 0x10000c1 0x41 0x10000c5 0x00 0x91 0x80 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x100003a 0x55 0x1000011 0x1000036 0x28 0x20000ff 0x1000029>;
			};

        };
    };

__overrides__ {
                speed =         <&disp>,"spi-max-frequency:0";
                txbuflen =      <&disp>,"txbuflen:0";
                rotate =        <&disp>,"rotate:0";
                fps =           <&disp>,"fps:0";
                bgr =           <&disp>,"bgr:0";
                debug =         <&disp>,"debug:0";
        };



};

 

I deleted everything regarding the Touch controller for now to avoid dealing with CS1. I just want to get the display to work.

 

My ArmbianEnv.txt looks like this: 

 

verbosity=1
bootlogo=false
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3 i2c0 uart1 tft35a
param_spidev_spi_bus=1
param_spidev_spi_cs=0
param_tft35a_rotate=90
param_tft35a_debug=1
rootdev=UUID=d522be3f-9ac0-489b-9d79-500c38e89c86
rootfstype=ext4
fbcon=map:1
hdmi_force_hotplug=1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

dmesg | grep spi  

gives me:

[   13.191545] [drm] Initialized ili9486 1.0.0 20200118 for spi0.0 on minor 0
[   15.079945] ili9486 spi0.0: [drm] fb0: ili9486drmfb frame buffer device

 

This output looks like that the IC is connected to SPI0, but I have to use SPI1 on the OPzero. I am referring to &SPI1 in my dts, so I am wondering where else I do have to select the Bus.

When I use the spi-dev overlay with the Option spidev_spi_bus=1 the Output for dmesg | grep spi  says that I am using SPI-Bus 1, but then I have some error that the CS 0 is already in use. 

 

according to:

dmesg | grep fb  

 

[    0.000000] Kernel command line: root=UUID=d522be3f-9ac0-489b-9d79-500c38e89c86 rootwait rootfstype=ext4 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 consoleblank=0 loglevel=1 ubootpart=22563e30-01 ubootsource=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1
[    3.919660]     sunxi_fb_mem_reserve=16
[   15.079945] ili9486 spi0.0: [drm] fb0: ili9486drmfb frame buffer device
[   15.143228] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   15.154104] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned.

 

A new /dev/fb0 device is registered, but the display stays white when I try to connect a console with con2fbmap 0 /dev/fb0 and activate the binding of the vtconsole. I get the same driver error as @olehs when I type sudo startx.

 

I am also wondering why I can't change the verbose level of fbtft when I change the debug level from 0..7 in the dts.  

 

 

Thank you for your advice! :)

 

Posted

Hi guys i am succesfuly run 3.5" tft touchscreen (waveshare) on my orangepi pc h3. I was record the video and share on my youtube channel. I took the video in my own language, but I shared the useful sources in the descriptions of the video.You can copy the commands I use in the video on my Github page.

 

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines