Jump to content

Recommended Posts

Posted

Starting with the DTS that worked for me in the orange pi zero 3, with ili9341:

 

 

https://forum.armbian.com/topic/44191-orangepi-zero-lts-ili9341-tft-lcd-and-later-orangepi-zero-3/?do=findComment&comment=204672

 

My DTS is for a customized set of pins that works for me, and it is different than/from the waveshare set of pins.

 

You need to change:

* file name change to: ili9486-ads7846-spi1.dts

* gpio pin selections everywhere in the DTS

* "adafruit,yx240qv29" should be "ilitek,ili9486"

* change "rotation" to "rotate"

* change "reset-gpios = <&pio N N 0>;" to "reset-gpios = <&pio N N 1>;

 

Then sudo armbian-add-overlay ili9486-ads7846-spi1.dts

Reboot

 

(does anyone know the correct DRM driver for ili9486?)

Posted (edited)

I used your DTS and modified the driver and some other things and it looked like this:

 

root@orangepizero3:~/testopiz3# cat ili9486-ads7846-spi1.dts
/dts-v1/;
/plugin/;
/ {
    compatible = "allwinner,sun50i-h616";
    fragment@0 {
        target = <&spi1>;
        __overlay__ {
            status = "okay";
            cs-gpios = <&pio 7 9 0>,<&pio 2 15 0>; /*PH9=CS0 for lcd, PC15=CS1 for touch*/
            ili9486: ili9486@0 {
                compatible = "ilitek,ili9486";
                reg = <0>;
                pinctrl-names = "default";
                spi-max-frequency = <24000000>;
                rotate = <270>;
                bgr = <0>;
                fps = <30>;
                buswidth = <8>;
                reset-gpios = <&pio 2 14 1>; /* PC14 */
                dc-gpios = <&pio 2 7 0>; /* PHC7 */
                debug = <3>;
            };

            ads7846: ads7846@1 {
                compatible = "ti,ads7846";
                reg = <1>;
                pinctrl-names = "default";
                spi-max-frequency = <1000000>;
                interrupt-parent = <&pio>;
                interrupts = <2 10 2>; /* PC10 - IRQ */
                pendown-gpio = <&pio 2 10 1>; /* PC10 */

                /* OPTIONS */
                ti,x-min = /bits/ 16 <0>;
                ti,y-min = /bits/ 16 <0>;
                ti,x-max = /bits/ 16 <0xFFF>;
                ti,y-max = /bits/ 16 <0xFFF>;
                ti,pressure-min = /bits/ 16 <0>;
                ti,pressure-max = /bits/ 16 <0xFFF>;
                ti,x-plate-ohms = /bits/ 16 <400>;
                ti,swap-xy = <1>;
            };
        };
    };

 

the screen didn't turn on and I get this:

 

root@orangepizero3:~/testopiz3# dmesg|grep spi
[    1.336361] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.336380] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.336625] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.336642] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.344519] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.344537] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.344790] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.344807] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.353376] spi-nor spi0.0: supply vdd not found, using dummy regulator
[    1.368687] spi-nor spi0.0: spi-nor-generic (16384 Kbytes)
[    5.756110] ads7846 spi1.1: supply vcc not found, using dummy regulator
[    5.774274] ads7846 spi1.1: touchscreen, irq 72
[    5.778306] [drm] Initialized ili9486 1.0.0 20200118 for spi1.0 on minor 2
[    5.791888] spi_master spi1: noqueue transfer failed
[    5.791896] ili9486 spi1.0: [drm] *ERROR* Failed to update display -5
[    5.806250] input: ADS7846 Touchscreen as /devices/platform/soc/5011000.spi/spi_master/spi1/spi1.1/input/input4
[    6.332084] spi_master spi1: noqueue transfer failed
[    6.341922] spi_master spi1: noqueue transfer failed
[    6.343037] ili9486 spi1.0: [drm] fb0: ili9486drmfb frame buffer device
[    6.376583] SPI driver fb_ili9486 has no spi_device_id for ilitek,ili9486
[    6.392717] spi_master spi1: noqueue transfer failed
[    6.484766] spi_master spi1: noqueue transfer failed
[    6.496428] spi_master spi1: noqueue transfer failed
[    6.507222] spi_master spi1: noqueue transfer failed
[    6.524186] spi_master spi1: noqueue transfer failed
[    6.583772] spi_master spi1: noqueue transfer failed
[    6.665947] spi_master spi1: noqueue transfer failed
[    6.683600] spi_master spi1: noqueue transfer failed
[    8.071086] spi_master spi1: noqueue transfer failed
[    8.225788] spi_master spi1: noqueue transfer failed
[    8.260765] spi_master spi1: noqueue transfer failed
[    8.423577] spi_master spi1: noqueue transfer failed
[    8.455263] spi_master spi1: noqueue transfer failed
[    8.522713] spi_master spi1: noqueue transfer failed
[    8.564872] spi_master spi1: noqueue transfer failed
[    8.575518] spi_master spi1: noqueue transfer failed
[    9.074598] spi_master spi1: noqueue transfer failed
[    9.084348] spi_master spi1: noqueue transfer failed
[    9.116925] spi_master spi1: noqueue transfer failed
[    9.131941] spi_master spi1: noqueue transfer failed
[    9.144523] spi_master spi1: noqueue transfer failed
[    9.155518] spi_master spi1: noqueue transfer failed
[    9.363656] spi_master spi1: noqueue transfer failed
[    9.378223] spi_master spi1: noqueue transfer failed
[    9.391305] spi_master spi1: noqueue transfer failed
[    9.402360] spi_master spi1: noqueue transfer failed
[    9.536236] spi_master spi1: noqueue transfer failed
[    9.644439] spi_master spi1: noqueue transfer failed
[   10.144929] spi_master spi1: noqueue transfer failed
[   10.268524] spi_master spi1: noqueue transfer failed
[   10.285998] spi_master spi1: noqueue transfer failed
[   10.295763] spi_master spi1: noqueue transfer failed
[   10.610540] spi_master spi1: noqueue transfer failed
[   10.778565] spi_master spi1: noqueue transfer failed
[   11.373986] spi_master spi1: noqueue transfer failed
[   11.536724] spi_master spi1: noqueue transfer failed
[   11.615775] spi_master spi1: noqueue transfer failed
[   11.630380] spi_master spi1: noqueue transfer failed
[   11.641227] spi_master spi1: noqueue transfer failed
[   11.691254] spi_master spi1: noqueue transfer failed
[   11.727754] spi_master spi1: noqueue transfer failed
[   11.738178] spi_master spi1: noqueue transfer failed
[   12.109599] spi_master spi1: noqueue transfer failed
[   12.305293] spi_master spi1: noqueue transfer failed
[   12.664486] spi_master spi1: noqueue transfer failed
[   12.674529] spi_master spi1: noqueue transfer failed
[   13.020004] spi_master spi1: noqueue transfer failed
[   13.032088] spi_master spi1: noqueue transfer failed
[   13.042854] spi_master spi1: noqueue transfer failed
[   13.074828] spi_master spi1: noqueue transfer failed
[   13.203632] spi_master spi1: noqueue transfer failed
[   13.315447] spi_master spi1: noqueue transfer failed
[   57.093748] spi_master spi1: noqueue transfer failed

Edited by WDR_s
Posted

I see that you didnt change any gpios. You must change them... what are the pins in the orange pi zero 3 that will control the lcd? (you must have the LCD schematic)

 

If you try my original DTS, without having a screen like mine, do you get these 2 files?

/dev/fb0

/dev/input/event0

 

According to this https://mjmwired.net/kernel/Documentation/devicetree/bindings/display/ilitek,ili9486.yaml

You must use the line:

compatible = "waveshare,rpi-lcd-35", "ilitek,ili9486";

Posted

I changed a few pins and the dts looked like this:

Spoiler

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun50i-h616";

        fragment@0 {
                target = <&spi1>;
                __overlay__ {
                        status = "okay";
                cs-gpios = <&pio 2 5 0>,<&pio 7 9 0>; /*PH5=CS0 for lcd, PH9=CS1 for touch*/
                };
        };

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

                        ili9486: ili9486@0 {
                                compatible = "ilitek,ili9486";
                                reg = <0>;
                                spi-max-frequency = <16000000>;
                                rotate = <90>;
                                fps = <30>;
                                buswidth = <8>;
                                regwidth = <16>;
                                bgr = <0>;
                                reset-gpios = <&pio 0 8 1>; /* PC15 */
                                dc-gpios = <&pio 0 5 0>; /* PC5*/
                                //debug = <3>;

                                init = <0x10000b0 0x00
                                        0x1000011
                                        0x20000ff
                                        0x100003a 0x55
                                        0x1000036 0x28
                                        0x10000c2 0x44
                                        0x10000c5 0x00 0x00 0x00 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
                                        0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
                                        0x1000036 0x28
                                        0x1000011
                                        0x1000029>;
                        };
                        ads7846: ads7846@1 {
                                compatible = "ti,ads7846";
                                reg = <1>;

                                spi-max-frequency = <2000000>;
                                interrupts = <2 7 2>; /* high-to-low edge triggered */
                                interrupt-parent = <&pio>;
                                pendown-gpio = <&pio 2 7 0>;
                                ti,keep-vref-on = <1>;
                                ti,x-min = /bits/ 16 <200>;
                                ti,x-max = /bits/ 16 <3900>;
                                ti,y-min = /bits/ 16 <200>;
                                ti,y-max = /bits/ 16 <3900>;
                                ti,x-plate-ohms = /bits/ 16 <60>;
                                ti,pressure-max = /bits/ 16 <255>;
                                ti,swap-xy = <1>;


                        };
                };
        };
};

 

the screen still doesn't give an image, but I get this:

Spoiler

root@orangepizero3:~# dmesg|grep spi

[ 1.329893] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517

[ 1.329912] sun6i-spi 5010000.spi: Error applying setting, reverse things back

[ 1.330164] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517

[ 1.330182] sun6i-spi 5011000.spi: Error applying setting, reverse things back

[ 1.340115] spi-nor spi0.0: supply vdd not found, using dummy regulator

[ 1.356682] spi-nor spi0.0: spi-nor-generic (16384 Kbytes)

[ 5.611681] SPI driver ads7846 has no spi_device_id for ti,tsc2046

[ 5.611706] SPI driver ads7846 has no spi_device_id for ti,ads7843

[ 5.611710] SPI driver ads7846 has no spi_device_id for ti,ads7845

[ 5.611715] SPI driver ads7846 has no spi_device_id for ti,ads7873

[ 5.612139] ads7846 spi1.1: supply vcc not found, using dummy regulator

[ 5.625190] ads7846 spi1.1: touchscreen, irq 71

[ 5.636919] input: ADS7846 Touchscreen as /devices/platform/soc/5011000.spi/spi_master/spi1/spi1.1/input/input0

[ 5.774741] SPI driver fb_ili9486 has no spi_device_id for ilitek,ili9486

[ 5.774845] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 5.774856] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 5.774863] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 5.774871] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 5.785022] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 5.785046] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 5.785054] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 5.785061] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 5.808854] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 5.808866] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 5.808873] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 5.808881] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 10.844939] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 10.844949] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 10.844956] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 10.844964] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 11.087041] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 11.087073] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 11.087083] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 11.087091] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 21.220361] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16

[ 21.220384] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8

[ 21.220391] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90

[ 21.220399] fb_ili9486 spi1.0: fbtft_property_value: fps = 30

[ 21.220581] spi spi1.0: deferred probe pending

 

do i have to add anything to /boot/armbianEnv.txt ? i'm in doubt!

Posted

Regarding these lines:

cs-gpios = <&pio 2 5 0>,<&pio 7 9 0>; /*PH5=CS0 for lcd, PH9=CS1 for touch*/

reset-gpios = <&pio 0 8 1>; /* PC15 */
dc-gpios = <&pio 0 5 0>; /* PC5*/

interrupts = <2 7 2>; /* high-to-low edge triggered */
pendown-gpio = <&pio 2 7 0>;

 

Make sure that you make the comments match with the actual DTS code, for example PH5=<&pio 7 5 0>, because H=7

Also according to the gpio formula, C=2.

Also insert some initial comment lines at the top, summarizing the pinout you discovered for the orange pi zero 3, to show your intermediate work

 

You are very close. All those spi1.0, spi1.1 dmesg messages indicate that there's no conflict internally in the CPU, but probably the one or a few IOs are connected to the incorrect pin(s). 

 

Another thing to try is change "reset-gpios = <&pio 0 8 1>" to "reset-gpios = <&pio 0 8 0>" because sometimes different kernel modules handle the polarity in the opposite way than it is expected.

Also try changing "compatible = "ilitek,ili9486";" to "compatible = "waveshare,rpi-lcd-35";" and look at the example in https://mjmwired.net/kernel/Documentation/devicetree/bindings/display/ilitek,ili9486.yaml to find the little differences in parameters.

 

Keep googling this forum for ili9486, maybe someone did it already :)

Posted

How is it going with the ili9486 LCD? :)


the armbianEnv.txt only needs the user-overlay line with the dts you are using (without the dts extension)… but seeing your progress, I am sure the armbianEnv.txt is perfect as it is now

 

your problem might be the gpio numbers (1st and 2nd parameter in <&pio xxx xxx xxx>) and the polarity setting (3rd parameter)

 

DO NOT ADD ANYTHING ELSE SPI RELATED

Posted

Thanks for asking!

I'm using this dts:

Spoiler

root@orangepizero3:~/testopiz3# cat ili9486-ads7846-spi1.dts
/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun50i-h616";

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

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

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

        fragment@1 {
                target = <&pio>;
                __overlay__ {
                        ili9486_pins: ili9486_pins {
                                allwinner,pins = "PC15", "PC14";
                                allwinner,function = "gpio_in", "gpio_in";
                        };
                };
        };

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

                        ili9486: ili9486@0{
                                compatible =  "ilitek,ili9486";
                                reg = <0>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&ili9486_pins>;

                                spi-max-frequency = <16000000>;
                                txbuflen = <32768>;
                                rotate = <90>;
                                bgr = <0>;
                                fps = <30>;
                                buswidth = <8>;
                                regwidth = <16>;
                                reset-gpios = <&pio 0 15 1>;
                                dc-gpios = <&pio 0 14 0>;
                                debug = <0>;

                                init = <0x10000b0 0x00
                                        0x1000011
                                        0x20000ff
                                        0x100003a 0x55
                                        0x1000036 0x28
                                        0x10000c2 0x44
                                        0x10000c5 0x00 0x00 0x00 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
                                        0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
                                        0x1000036 0x28
                                        0x1000011
                                        0x1000029>;
                        };

                };
        };

};

 

Come on, even if I change the pins I still get the same thing. 
 

Spoiler

root@orangepizero3:~# dmesg|grep spi
[    1.329785] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.329803] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.330040] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.330057] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.338159] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.338177] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.338407] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.338424] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.346464] spi-nor spi0.0: supply vdd not found, using dummy regulator
[    1.364614] spi-nor spi0.0: spi-nor-generic (16384 Kbytes)
[    5.757805] SPI driver fb_ili9486 has no spi_device_id for ilitek,ili9486
[    5.758014] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16
[    5.758033] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8
[    5.758046] fb_ili9486 spi1.0: fbtft_property_value: debug = 0
[    5.758057] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90
[    5.758070] fb_ili9486 spi1.0: fbtft_property_value: fps = 30
[    5.758081] fb_ili9486 spi1.0: fbtft_property_value: txbuflen = 32768
[    5.809159] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16
[    5.809172] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8
[    5.809179] fb_ili9486 spi1.0: fbtft_property_value: debug = 0
[    5.809185] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90
[    5.809192] fb_ili9486 spi1.0: fbtft_property_value: fps = 30
[    5.809198] fb_ili9486 spi1.0: fbtft_property_value: txbuflen = 32768
[   10.473865] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16
[   10.473880] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8
[   10.473889] fb_ili9486 spi1.0: fbtft_property_value: debug = 0
[   10.473897] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90
[   10.473906] fb_ili9486 spi1.0: fbtft_property_value: fps = 30
[   10.473914] fb_ili9486 spi1.0: fbtft_property_value: txbuflen = 32768
[   11.180842] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16
[   11.180863] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8
[   11.180871] fb_ili9486 spi1.0: fbtft_property_value: debug = 0
[   11.180877] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90
[   11.180884] fb_ili9486 spi1.0: fbtft_property_value: fps = 30
[   11.180891] fb_ili9486 spi1.0: fbtft_property_value: txbuflen = 32768
[   21.220456] fb_ili9486 spi1.0: fbtft_property_value: regwidth = 16
[   21.220480] fb_ili9486 spi1.0: fbtft_property_value: buswidth = 8
[   21.220487] fb_ili9486 spi1.0: fbtft_property_value: debug = 0
[   21.220493] fb_ili9486 spi1.0: fbtft_property_value: rotate = 90
[   21.220501] fb_ili9486 spi1.0: fbtft_property_value: fps = 30
[   21.220507] fb_ili9486 spi1.0: fbtft_property_value: txbuflen = 32768
[   21.220809] spi spi1.0: deferred probe pending

 

And when I change the driver compatibility from “compatible = ‘ilitek,ili9486’;” to “compatible = ‘waveshare,rpi-lcd-35’;”, it shows this:

Spoiler

root@orangepizero3:~# dmesg|grep spi
[    1.331757] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.331776] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.332039] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.332056] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.341951] spi-nor spi0.0: supply vdd not found, using dummy regulator
[    1.356645] spi-nor spi0.0: spi-nor-generic (16384 Kbytes)
[   21.992398] spi spi1.0: deferred probe pending

 

Posted

Every time I change the pins, the driver doesn't load correctly, it always shows me the same driver message.

Spoiler

SPI driver fb_ili9486 has no spi_device_id for ilitek,ili9486

 

this error is the wrong pins, but I haven't found a way to solve it yet.
Do you have any suggestions? 
 

Posted (edited)

I used your dts, I just changed the drivers:

Spoiler

root@orangepizero3:~/testopiz3# cat ili9486-ads7846-spi1.dts
/*
OrangePi Zero 3 -> ILI9846LCD connections
SPI CLOCK = PH6
SPI DO (LCD MISO) = PH8 (OPIZ MISO)
SPI DI (LCD MOSI) = PH7 (OPIZ MOSI)
LCD DATA/CONTROL = PC15
LCD RESET = PC10
CHIP SELECT = PH9 < NOT USED ANYMORE ;)
VCC = 3.3V PIN
GND = GND PIN
*/

/dts-v1/;
/plugin/;
/{
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
        fragment@0 {
            target = <&pio>;
            __overlay__{
                display_pins: display_pins {
                    pins = "PC8", "PC10"; /* DC, reset pins*/
                    function = "gpio_out", "gpio_out";
                };
            };
        };
        fragment@1 {
        target = <&spi1>;
        __overlay__ {
            /* needed to avoid dtc warning */
            #address-cells = <1>;
            #size-cells = <0>;
            status="okay";
            pinctrl-names = "default";
            pinctrl-0 = <&spi1_pins>; /* Mux the PI to make sure they are set in spi Mode */
            /*cs-gpios = <&pio 0 13 0>;  /* PA13 chip select NOT USED! */
            num-chipselects = <0>;
            display: display@0 {
                compatible = "waveshare,rpi-lcd-35","ilitek,ili9486";
                /*compatible = "ilitek,ili9486";*/
                reg = <0>;
                pinctrl-names = "default";
                pinctrl-1 = <&display_pins>;
                spi-max-frequency = <16000000>;
                rotation = <270>; /* rotate for ili9486, rotation for rpi-lcd-35 */
                bgr=<0>;
                fps = <15>;
                buswidth = <8>;
                reset-gpios = <&pio 2 10 0>; /* PC10 reset pin*/
                dc-gpios = <&pio 2 8 0>; /* PC8 Data control pin */
                debug = <3>;
                init = <0x10000b0 0x00
                        0x1000011
                        0x20000ff
                        0x100003a 0x55
                        0x1000036 0x28
                        0x10000c2 0x44
                        0x10000c5 0x00 0x00 0x00 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
                        0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
                        0x1000036 0x28
                        0x1000011
                        0x1000029>;
            };
        };
    };


    __overrides__ {
        rotate =  <&display>,"rotate:0";
        fps =     <&display>,"fps:0";
        debug =   <&display>,"debug:0";
    };
};

 

i knew it wouldn't work, but it starts the driver on your dts.
 

Spoiler

root@orangepizero3:~# dmesg|grep spi
[    1.331860] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517
[    1.331878] sun6i-spi 5010000.spi: Error applying setting, reverse things back
[    1.332144] sun50i-h616-pinctrl 300b000.pinctrl: pin-230 (5011000.spi) status -517
[    1.332162] sun6i-spi 5011000.spi: Error applying setting, reverse things back
[    1.342085] spi-nor spi0.0: supply vdd not found, using dummy regulator
[    1.356632] spi-nor spi0.0: spi-nor-generic (16384 Kbytes)
[    5.826794] [drm] Initialized ili9486 1.0.0 20200118 for spi1.0 on minor 2
[    5.846062] spi_master spi1: noqueue transfer failed
[    5.846070] ili9486 spi1.0: [drm] *ERROR* Failed to update display -5
[    6.392853] spi_master spi1: noqueue transfer failed
[    6.401813] spi_master spi1: noqueue transfer failed
[    6.402930] ili9486 spi1.0: [drm] fb0: ili9486drmfb frame buffer device
[    6.493015] spi_master spi1: noqueue transfer failed
[    6.601019] spi_master spi1: noqueue transfer failed
[    6.612073] spi_master spi1: noqueue transfer failed
[    6.623854] spi_master spi1: noqueue transfer failed
[    6.641744] spi_master spi1: noqueue transfer failed
[    6.751695] spi_master spi1: noqueue transfer failed
[    6.846563] spi_master spi1: noqueue transfer failed
[    6.880841] spi_master spi1: noqueue transfer failed
[    6.891036] spi_master spi1: noqueue transfer failed
[    6.904580] spi_master spi1: noqueue transfer failed
[    6.914475] spi_master spi1: noqueue transfer failed
[    7.142242] spi_master spi1: noqueue transfer failed
[    7.226228] spi_master spi1: noqueue transfer failed
[    7.268840] spi_master spi1: noqueue transfer failed
[    9.517124] spi_master spi1: noqueue transfer failed
[   10.039018] spi_master spi1: noqueue transfer failed
[   10.232173] spi_master spi1: noqueue transfer failed
[   10.275680] spi_master spi1: noqueue transfer failed
[   10.690564] spi_master spi1: noqueue transfer failed
[   10.731026] spi_master spi1: noqueue transfer failed
[   10.805702] spi_master spi1: noqueue transfer failed
[   10.858116] spi_master spi1: noqueue transfer failed
[   10.871689] spi_master spi1: noqueue transfer failed
[   10.907571] spi_master spi1: noqueue transfer failed
[   11.375140] spi_master spi1: noqueue transfer failed
[   11.384944] spi_master spi1: noqueue transfer failed
[   11.420367] spi_master spi1: noqueue transfer failed
[   11.433719] spi_master spi1: noqueue transfer failed
[   11.445033] spi_master spi1: noqueue transfer failed
[   11.456640] spi_master spi1: noqueue transfer failed
[   11.544898] spi_master spi1: noqueue transfer failed
[   11.559093] spi_master spi1: noqueue transfer failed
[   11.579468] spi_master spi1: noqueue transfer failed
[   11.591184] spi_master spi1: noqueue transfer failed
[   11.625091] spi_master spi1: noqueue transfer failed
[   11.644903] spi_master spi1: noqueue transfer failed
[   11.656759] spi_master spi1: noqueue transfer failed
[   11.668277] spi_master spi1: noqueue transfer failed
[   11.679463] spi_master spi1: noqueue transfer failed
[   11.839080] spi_master spi1: noqueue transfer failed
[   11.944803] spi_master spi1: noqueue transfer failed
[   12.044634] spi_master spi1: noqueue transfer failed
[   12.129035] spi_master spi1: noqueue transfer failed
[   12.311136] spi_master spi1: noqueue transfer failed
[   12.711328] spi_master spi1: noqueue transfer failed
[   12.743744] spi_master spi1: noqueue transfer failed
[   12.754734] spi_master spi1: noqueue transfer failed
[   13.128266] spi_master spi1: noqueue transfer failed
[   13.377586] spi_master spi1: noqueue transfer failed
[   13.550212] spi_master spi1: noqueue transfer failed
[   13.750005] spi_master spi1: noqueue transfer failed
[   14.008841] spi_master spi1: noqueue transfer failed
[   14.074675] spi_master spi1: noqueue transfer failed
[   14.085395] spi_master spi1: noqueue transfer failed
[   14.095476] spi_master spi1: noqueue transfer failed
[   14.110914] spi_master spi1: noqueue transfer failed
[   14.158867] spi_master spi1: noqueue transfer failed
[   14.204317] spi_master spi1: noqueue transfer failed
[   14.214390] spi_master spi1: noqueue transfer failed
[   15.225220] spi_master spi1: noqueue transfer failed
[   16.014905] spi_master spi1: noqueue transfer failed
[   16.024943] spi_master spi1: noqueue transfer failed
[   16.106431] spi_master spi1: noqueue transfer failed
[   16.120397] spi_master spi1: noqueue transfer failed
[   16.131900] spi_master spi1: noqueue transfer failed
[   16.168199] spi_master spi1: noqueue transfer failed
[   16.184874] spi_master spi1: noqueue transfer failed
[   16.219440] spi_master spi1: noqueue transfer failed
[   16.256967] spi_master spi1: noqueue transfer failed
[   16.315349] spi_master spi1: noqueue transfer failed

 

 

Edited by WDR_s
Posted

Hello.
On this screen you need CS, when connected directly to the board, using dupont I'm not sure because I don't have it. 

 

The driver will only load if reset and dc are set to 2.

At the moment that's all I've found, but it still gives an error when it loads the driver, so I'm trying to solve it.

Spoiler

reset-gpios = <&pio 2 0 0>:
dc-gpios = <&pio 2 0 0>: 

 

Posted

Those 2 lines contradict each other: both reset and dc (data/command) cant be the same.

 

Can you send a drawing of the wiring between the orange pi zero and the LCD display? (in terms of SPI-MISO, MOSI, DC, RESET, LED, etc, and the DTS you have just tried?

Posted

I know that, I was just giving an example. 

it should be like this: <&pio 2 N N>:

I'm currently using this one:

Spoiler

/dts-v1/;
/plugin/;
/ {
    compatible = "allwinner,sun50i-h616";
    fragment@0 {
        target = <&spi1>;
        __overlay__ {
            status = "okay";
        cs-gpios = <&pio 2 9 0>,<&pio 7 15 0>; /*PH9=CS0 for lcd, PC15=CS1 for touch*/
            ili9486: ili9486@0 {
                compatible = "ilitek,ili9486";
                reg = <0>;
                pinctrl-names = "default";
                spi-max-frequency = <24000000>;
                rotation = <270>;
                bgr = <0>;
                fps = <30>;
                buswidth = <8>;
                reset-gpios = <&pio 2 14 0>; /* PC14 */
                dc-gpios = <&pio 2 7 0>; /* PHC7 */
                debug = <3>;

           };
        };
    };
};

 

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