Jump to content

Connecting banana pi m2 zero with ili9341 display over spi on latest armbian image


yaya8888

Recommended Posts

Hello guys,

i'm trying to connect that ili9341 display with my m2 zero but it wont work. My armbian Version:  Armbian_23-02-0-trunk_Bananapim2zero_lunar_edge_6.1.11_xfce_desktop

The display has a pinout that matches  with the raspberry pi, so also the banana pi m2 zero would do the job, since it has the same pinout like the raspberry pi has.

It uses 26 pins to connect to the banana pi m2 zero gpio output pins. 3 buttons and a touch panel are available but i only want to use the lcd for now.

 

I edited the armbianEnv.txt to open the spi port and added my overlay tft.dts to /boot/overlay-user but i cant get a picture on the screen, Its just glowing white.

Am I missing something? Are my gpios numbers in the overlay correct? do i have to install additional software?

 

I would be very happy for tips or help!

 

 

My armbianEnv.txt :

 

 

verbosity=1

bootlogo=false

console=both

disp_mode=1920x1080p60

overlay_prefix=sun8i-h3

rootdev=UUID=39f6ab06-e14f-4885-8454-717c5405f006

rootfstype=ext4

overlays=cpu-clock-1.2GHz-1.3v spi-spidev

param_spidev_spi_bus=0

user_overlays=tft

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

 

My overlay tft.dts

 

/dts-v1/;

/plugin/;

 

/ {

compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

 

fragmen@0 {

target = <&pio>;

__overlay__ {

display_pins: display_pins {

pins = "PC0", "PC3";

function = "gpio_out";

};

};

};

 

fragment@1 {

target = <&spi0>;

__overlay__ {

/* needed to avoid dtc warning */

#address-cells = <1>;

#size-cells = <0>;

 

display: display@0 {

compatible = "adafruit,yx240qv29", "ilitek,ili9341";

reg = <0>;

pinctrl-names = "default";

pinctrl-0 = <&display_pins>;

spi-max-frequency = <16000000>;

rotation= <270>;

bgr;

fps = <10>;

buswidth = <8>;

height = <240>;

width = <320>;

reset-gpios = <&pio 0 25 0>; /* GPIOA 6 */

dc-gpios = <&pio 0 24 0>; /* GPIOA 3 */

debug = <3>;

};

};

};

 

__overrides__ {

rotation = <&display>, "rotation:0";

fps = <&display>, "fps:0";

debug = <&display>, "debug:0";

};

};

 

 

 

 

 

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

Hi there,

 

I have also been trying to get an ili9341 display to work on my board as well. still learning about overlays but from what I can tell from my own test is that gpio's should be <&pio 0 6 0> and <&pio 0 3 0>  in your case rather than:

On 3/21/2023 at 5:46 PM, yaya8888 said:

reset-gpios = <&pio 0 25 0>; /* GPIOA 6 */

dc-gpios = <&pio 0 24 0>; /* GPIOA 3 */

The first number refers to the bank so A=0 followed by the pin on that bank so 6.

 

did you do a loop back test to see that SPI was at least working first?

 

if so did you the check lsmod to see if the ili9341 module has loaded? should probably look a bit like this:

 

lsmod | grep ili9341
ili9341                16384  0
panel_ilitek_ili9341    20480  0
drm_mipi_dbi           24576  2 ili9341,panel_ilitek_ili9341

 

Admittedly I only got as far as the modules loading but I still had a white display, I can only assume so far that there may be some kind of additional configuration file that has to be setup so that it can be used as a desktop. one other problem I noticed when upgrading my kernel from 5.15 to 6.1 was that the ili9341 driver was no longer include by default other than the fb_ili9341 which I think may be the older fbtft based driver. I ended up have to use the build scripts to include the drm based ili9341 which from what I have read is the newer driver.

 

 

Hopefully this at least provided a helpful starting point and best of luck.

 

 

 

Link to comment
Share on other sites

Hey tried the same thing aswell on a bananapiM2 Armbian 23.05.0-trunk Lunar,  kernel Linux 6.2.13. I'm not too good at coding so I just went ahead an copied most of the code for the overlay and the boot configuration.

Running: lsmod |grep ili9341 results in the same as previously mentioned.

lsmod | grep ili9341
ili9341                16384  0
panel_ilitek_ili9341    20480  0
drm_mipi_dbi           24576  2 ili9341,panel_ilitek_ili9341

 

However checking dmesg for the spi entires reveals that ther might be a problem with the used port param_spidev_spi_bus=0

Running dmesg | grep spi results in the following:

 dmesg | grep spi
[    3.073618] sun8i-h3-pinctrl 1c20800.pinctrl: pin PC0 already requested by 1c68000.spi; cannot claim for spi0.1
[    3.073657] sun8i-h3-pinctrl 1c20800.pinctrl: pin-64 (spi0.1) status -22
[    3.073689] panel-ilitek-ili9341 spi0.1: Error applying setting, reverse things back
[    3.076126] sun8i-h3-pinctrl 1c20800.pinctrl: pin PC0 already requested by 1c68000.spi; cannot claim for spi0.1
[    3.076166] sun8i-h3-pinctrl 1c20800.pinctrl: pin-64 (spi0.1) status -22
[    3.076196] ili9341 spi0.1: Error applying setting, reverse things back

 

So I think the problem lies in the selected spi bus rahter than in the code itself, since on start up the panel is reversed. Or do you have different opinion/idea? :huh:

Link to comment
Share on other sites

Hi there,

 

I see that you have enabled spidev which isn't necessary. you just need to enable just the SPI bus which can be done within the overlay. overwise it will just conflict with the ili9341. slightly amended overlay:

dts-v1/;
/plugin/;

/{

    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

    fragmen@0 {

        target = <&pio>;

        __overlay__ {

            display_pins: display_pins {

            pins = "PI11", "PI12";

            function = "gpio_out";

                        };

                        display_cs_pin: display_cs_pin {

                pins = "PB2";

                function = "gpio_out";

                output-high;

            };

        };

    };

    fragment@1 {

        target = <&spi0>;

        __overlay__ {

            /* needed to avoid dtc warning */

            #address-cells = <1>;

            #size-cells = <0>;

            status="okay";

            num-chipselects = <1>;

            display: display@0 {

                compatible = "adafruit,yx240qv29", "ilitek,ili9341";

                reg = <1>;

                spi-max-frequency = <32000000>;

                pinctrl-names = "default";

                pinctrl-0 = <&display_pins>;

                rotation= <90>;

                bgr;

                fps = <25>;

                buswidth = <8>;

                height = <240>;

                width = <320>;

                /*reset-gpios = <&pio 0 25 0>; */ /* GPIOA 6 */

                dc-gpios = <&pio 8 3 0>; /* GPIOA 3 */

                cs-gpios = <0>,<&pio 1 2 0>; /* PB2 - Linksprite shield TFT cs pin */

                debug = <3>;

            };

        };

    };

    

 

Just remember to change the pins back to those used bananapiM2 as the current configuration is for my Pcduino.

 

Also could you include a datasheet for your particular display, it would be helpful to know what pins are used for dc and cs.

 

Link to comment
Share on other sites

thx for the great new input, will try out fruchtzwergs and ryzers suggestions in the weekend. i also had the info that that pc0 was already requested. the pinout in the wiki doc is also a bit faulty, the (only) pwm pin isnt  pin 7 but the rx pin of the uart. more feedback will follow.

Link to comment
Share on other sites

Hello there :)

 

Thx a lot for all the informations I am finally getting closer to really understand what I am doing and how everything is working. I manage to properly initalise my screen in the lastest armbian lunar version:

 dmesg | grep ili9341
[    2.899560] panel-ilitek-ili9341 spi0.1: get optional vcc failed
[    2.908867] [drm] Initialized ili9341 1.0.0 20210716 for spi0.1 on minor 1
[    3.746474] panel-ilitek-ili9341 spi0.1: [drm] Initialized display serial interface
[    3.969566] panel-ilitek-ili9341 spi0.1: [drm] fb0: ili9341drmfb frame buffer device

Still no picture on the screen but personally a hugh success for me and a motivational boost ;) 

I found a usfull link to a good description unfortunatly it is in german but I can translate it if needed.
German Guide Spi lcd ili9431

I am using a different screen on from adafruit https://www.adafruit.com/product/2423 I took a look at the pcb and could Identify almost all the required pin appart from the reset pin and they are the same as this setup from the german guide:

xk00mrvux6mlo4zkbqpevsgofkg.png

 

therefore I used the following code overlay and managed to at least initiate the display.

/dts-v1/;

/plugin/;



/ {

compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";



fragmen@0 {

target = <&pio>;

__overlay__ {

display_pins: display_pins {

pins = "PD4", "PC0";

function = "gpio_out", "gpio_out";

};

};

};



fragment@1 {

target = <&spi1>;

__overlay__ {

/* needed to avoid dtc warning */

#address-cells = <1>;

#size-cells = <0>;

status="okay";

cs-gpios = <&pio 3 0 0>;

num-chipselects = <1>;

display: display@0 {

compatible = "adafruit,yx240qv29", "ilitek,ili9341";

reg = <1>;

pinctrl-names = "default";

pinctrl-0 = <&display_pins>;

spi-max-frequency = <8000000>;

rotation= <270>;

bgr = <0>;

fps = <10>;

buswidth = <8>;

height = <240>;

width = <320>;

reset-gpios = <&pio 3 4 1>; /* GPIO 24 */

dc-gpios = <&pio 2 0 0>; /* GPIO 25 */

debug = <3>;

};

};

};



__overrides__ {

rotation = <&display>, "rotation:0";

fps = <&display>, "fps:0";

debug = <&display>, "debug:0";

};

};

Lots of text and I hope it can help 

Edited by Fruchtzerg
typo
Link to comment
Share on other sites

Hi There,

 

Small progress is still progress :) . Thanks for the offer but not need, auto translate was good enough apart from one or two sentences. Indeed it is very good guide that surprising doesn't refer to the old fb driver or the FBCP library that works on the Raspberry PI only due to direct register interactions. Still not have a lot of luck with my display, still just a white screen just like yours. I wonder if it could perhaps be related to the chip select. Luckily the Pcduino has an led attached to the SPI clock line so I can see clear that data is being sent to the display but nothing else is happening. The display is made by Linksprite but it's basically a clone of the older generation of a display made by Adafruit: https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2.

 

Anyway, your overlay looks good. I would just suggest changing the pins used, the guide refers to the BPI-M64 which has different pin map to that used on your BPI-M2. Please see: https://wiki.banana-pi.org/Banana_Pi_BPI-M2_ZERO. If you replace chip select with PA13 and the data control with PC4 then hopefully it should work. You can also change the reset pin to PA2 although I am not sure if the reset line is strictly necessary.

 

Best of luck

Link to comment
Share on other sites

Finally it works or at least I can see the console here's the overlay I used

 sudo vim /boot/dtb/overlay/bananapitft.dts
/dts-v1/;

/plugin/;



/ {

compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";



fragmen@0 {

target = <&pio>;

__overlay__ {

display_pins: display_pins {

pins = "PC4", "PA2";

function = "gpio_out", "gpio_out";

};

};

};



fragment@1 {

target = <&spi0>;

__overlay__ {

/* needed to avoid dtc warning */

#address-cells = <1>;

#size-cells = <0>;

status="okay";

cs-gpios = <&pio 2 3 0>;

num-chipselects = <1>;

display: display@0 {

compatible = "adafruit,yx240qv29", "ilitek,ili9341";

reg = <0>;

pinctrl-names = "default";

pinctrl-0 = <&display_pins>;

spi-max-frequency = <8000000>;

rotation= <270>;

bgr = <0>;

fps = <10>;

buswidth = <8>;

height = <240>;

width = <320>;

reset-gpios = <&pio 2 4 1>; /* GPIO 24 */

dc-gpios = <&pio 0 2 0>; /* GPIO 25 */

debug = <3>;

};

};

};



__overrides__ {

rotation = <&display>, "rotation:0";

fps = <&display>, "fps:0";

debug = <&display>, "debug:0";

};

};

I did a stupid copy paste mistake and targeted spi1 insead of spi0

 

also manually compiling the .dts gave me warnings that didn't show up while using the armbian-add-overlay maybe that makes a difference as well but right now I am too lasy to check that.

 

Thank you all for your help wouldn't been able to do it without it :)))

Display.jpeg

Link to comment
Share on other sites

Hi there,

 

@FruchtzergGlad to here you got it up and running. Much appreciated, I also learned from you that my cs-gpio node was in the wrong position and correcting got mine up and running. So here is the final revision of my dts overlay:

 

/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 = "PB2", "PI3";

                function = "gpio_out", "gpio_out";

            };

        };

	};

	fragment@1 {

        target = <&spi0>;

        __overlay__ {

            /* needed to avoid dtc warning */

            #address-cells = <1>;

            #size-cells = <0>;

            status="okay";

            pinctrl-names = "default";

            pinctrl-0 = <&spi0_pi_pins>; /* Mux the PI to make sure they are set in spi Mode*/

            cs-gpios = <&pio 1 2 0>; /* PB2 (D5) - Linksprite shield TFT CS pin */

            num-chipselects = <1>;

            display: display@0 {

                compatible = "adafruit,yx240qv29", "ilitek,ili9341";

                pinctrl-names = "default";

                pinctrl-1 = <&display_pins>;

                reg = <0>;

                spi-max-frequency = <12000000>;

                rotation = <270>;

                bgr = <0>;

                fps = <15>;

                buswidth = <8>;

                height = <240>;

                width = <320>;

                reset-gpios = <&pio 7 9 0>; /* PH9 (D7) */

                dc-gpios = <&pio 8 3 0>; /* PI3 (D6) - Data control pin */

                debug = <3>;

            };
            

        };

    };


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

};

    

 

 

OCSI9444.thumb.JPG.122f80dab0a41eb49bd11edf0127cb25.JPG

 

 

 

 

Would have been interesting to see what they where, not that it ultimately matters now that its working.

 

To get the desktop working you will need to tinker around with the Xorg/Xserver configuration. I have tried to manual trigger it to start but it keeps failing for a reason I have yet to identify other than this currently cryptic error '(EE) FBDEV(0): FBIOPUTCMAP: Device or resource busy' appearing a lot in /var/log/Xorg.0.log

 

Well at least get the the touchscreen to work should be a lot easier now. From what I can see it is I2C based so you can easily get some form of identification from i2c-tools. Again it is configured in the device tree in a similar way to SPI but instead of spidev you have i2c-dev acting as the dummy receiver device. Looking forward to seeing an update with the display working and hopefully the touch panel working.

 

All the best 

 

Ryzer

 

 

 

 

Link to comment
Share on other sites

Yep so I got the Xorg running and it show the armbian screen but I have a similar error message in the Xorg.0.log as you got (==) FBDEV(0): Backing store enabled
[   199.430] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument

For my bananapi the HDMI is deactivated if there is no cable on startup so my lcd display becomes fb0 maybe you are trying to start on the wrong device? But from here on I can only make some guesses since i have never before worked with Xorg 

 (==) FBDEV(0): Backing store enabled
[   199.430] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument

 

This seems not to cause any problem however connecting a mouse or a keyboard always fails. This is then probably related to the xorg config file which I created following the previously mentioned guide.

 

Then I just execute sudo startxfce4 an I get the desktop on my display.  

desktop.jpeg

Link to comment
Share on other sites

Hello,  I am also trying to get my ILI9341 TFT working on my Orange Pi Zero... which also has an H3 (only different GPIOs, and SPI1, instead of SPI0)

 

In august 2024, have the people who succeeded in using the ILI9341 upgraded to Linux 6.6.x? Can you share the complete armbianEnv.txt and dts? Thank you! :)

Link to comment
Share on other sites

Hi robertoj,

 

I have had some partial success with kernel 6.6 with my pcduino however I am not sure if the chip select issue I am currently facing would be relevant to you given its A10 which use a different SPI driver to the H3. What I would Intially suggest is making sure the pins that you are using are configure in the pin controller. You can check this by looking /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins and then using grep spi1 to filter out pins other than those used by spi1. Secondly check that the drm based ili9341 driver is present on your system and that you are not using the older fb_ili9341 which has been deprecated and has no garentee of working in newer kernels.

 

Best of luck

Ryzer

Link to comment
Share on other sites

Thank you for your comment :)

 

I will the sys/kernel file :) Yes, there is a ili9341 module loaded

 

It just appears to expect the correct SPI 1.0, BUT the spidev driver is not creating the /dev/spi1.0 device, only spi0.0...

 

and when I change the armbianEnv.txt to use bus 1 (for MISO1, MOSI 1), the spidev driver does not create any /dev/spiX.X

 

When I deactivate the custom ili9341.dtbo, with references to spi1, spidev works again.

 

I can't find a definitive answer about activating spi-dev.dtbo in armbian-config>hardware... yes or no?

 

Ideally, someone with a positive experience with Allwinner H3 will chime in here :)

Link to comment
Share on other sites

Hi robertoj,

 

Do not activate spidev as I have mention above, doing so will cause a conflict. The Spidev driver and the ili9341 cannot access the spi bus at the same time. Without seeing your currently overlay its difficult to provide further assistance.

 

Best of luck

Ryzer

Link to comment
Share on other sites

Thank you, now I am trying without spidev.dtbo, and checking my modifications to the dts you posted here on June 10, 2023

 

Spoiler
roberto@orangepizero:~/ili9341$ cat ili9341-spi1.dts 
/*
OrangePi Zero connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
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 = "PA18", "PA2"; /* DC pin and RESET pin */
                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_pi_pins>; /* Mux the PI to make sure they are set in spi Mode*/
            cs-gpios = <&pio 0 13 0>; /* PA13 chip select */
            num-chipselects = <1>;
            display: display@0 {
                compatible = "adafruit,yx240qv29", "ilitek,ili9341";
                pinctrl-names = "default";
                pinctrl-1 = <&display_pins>;
                reg = <0>;
                spi-max-frequency = <12000000>;
                rotation = <270>;
                bgr = <0>;
                fps = <15>;
                buswidth = <8>;
                height = <240>;
                width = <320>;
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 Data control pin */
                debug = <3>;
            };
        };
    };


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

 

 

and my armbianEnv.txt

Spoiler
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=tve usbhost2 usbhost3
rootdev=UUID=037205e3-4f65-4926-935f-eaa5a9e7ffd5
rootfstype=ext4
user_overlays=ili9341-spi1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

 

What tests should I do to see that the SPI is being initialized? When I run dmesg and lsmod, there's nothing with spi or ili9341

 

I found that in my linux build config, I only have CONFIG_FB_TFT_ILI9341=m, but two other lines referring to ILI9341 are disabled:

# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set

# CONFIG_TINYDRM_ILI9341 is not set

 

Results for sys pinctrl query: nothing showing spi0 or spi1

Spoiler
roberto@orangepizero:/boot$ sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins 
[sudo] password for roberto: 
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 14 (PA14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 15 (PA15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 16 (PA16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PC3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (PC4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 69 (PC5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 70 (PC6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 71 (PC7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 72 (PC8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 73 (PC9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 74 (PC10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 75 (PC11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 76 (PC12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 77 (PC13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 78 (PC14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 79 (PC15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 80 (PC16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 96 (PD0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 97 (PD1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 98 (PD2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 99 (PD3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 100 (PD4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 101 (PD5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 102 (PD6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (PD7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 104 (PD8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 105 (PD9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 106 (PD10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 107 (PD11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 108 (PD12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 109 (PD13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 110 (PD14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (PD15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (PD16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (PD17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (PE0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (PE1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (PE2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (PE3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (PE4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (PE5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (PE6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (PE7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (PE8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (PE9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (PE10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (PE11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (PE12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (PE13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 142 (PE14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 143 (PE15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 160 (PF0): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF0
pin 161 (PF1): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF1
pin 162 (PF2): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF2
pin 163 (PF3): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF3
pin 164 (PF4): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF4
pin 165 (PF5): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF5
pin 166 (PF6): (MUX UNCLAIMED) 1c20800.pinctrl:166
pin 192 (PG0): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG0
pin 193 (PG1): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG1
pin 194 (PG2): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG2
pin 195 (PG3): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG3
pin 196 (PG4): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG4
pin 197 (PG5): 1c10000.mmc (GPIO UNCLAIMED) function mmc1 group PG5
pin 198 (PG6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 199 (PG7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 200 (PG8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 201 (PG9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 202 (PG10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 203 (PG11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 204 (PG12): (MUX UNCLAIMED) 1c20800.pinctrl:204
pin 205 (PG13): (MUX UNCLAIMED) (GPIO UNCLAIMED)

 

 

Should I be seeing /dev/spi1.0 created?

 

I verified that I only have fb_ili9341.ko, but not ili9341.ko... I will build my armbian image with it. https://paste.armbian.com/agijolubij need Ubuntu VM XD

Link to comment
Share on other sites

Hi robertoj,

 

Looking at your overlay it looks almost there. The &spi0_pi_pins that I used will not work for the H3 as it has no port I exposed. Looking at pin controller section of the sunxi-h3-h5.dtsi spi0 only seems routed to one place so in this case you only need spi1_pins. please see here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi?h=v6.6.47 If using the native chip select cs-gpios is not necessary unless you have a second chip select line that is normal gpio. Unfortunately it wont show under /dev/ however you can check if an spi bus is enabled by looking at /proc/device-tree/soc/spi@1c69000/status. Its odd that you dont have it by default, I thought both are still included at least in the current kernels.

 

Best of luck

Ryzer

Link to comment
Share on other sites

Thank you Ryzer... I left my home, with the PC building an armbian image :)

 

ili9341 is available in the linux menuconfig, activated by default.

 

However, I didn't find the ili9341.ko in the armbian-provided image (Noble)

Link to comment
Share on other sites

Ok, I finally have a newly built Ubuntu Noble, with ili9341.ko in the /lib/modules/... folder

 

I added the DTS again:

Spoiler

 

roberto@orangepizero:~/ili9341_driver$ sudo armbian-add-overlay ili9341-spi1.dts
Compiling the overlay
Copying the compiled overlay file to /boot/overlay-user/
Reboot is required to apply the changes
roberto@orangepizero:~/ili9341_driver$ cat /boot/armbianEnv.txt 
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3 tve
rootdev=UUID=8e7e419c-d3b1-4a4f-ac77-fcfab72d2a90
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
user_overlays=ili9341-spi1
roberto@orangepizero:~/ili9341_driver$

 

I rebooted and there was no action in the TFT display.

 

Also, nothing in dmesg indicated it that ili9341 was attempted to use... neither "spi" was found in dmesg

 

I saw that the pins I want to use for SPI are not in use:

Spoiler
sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins
[sudo] password for roberto: 
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 14 (PA14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 15 (PA15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 16 (PA16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)

 

Also, checking the proc, shows that both SPIs are disabled:

Spoiler
roberto@orangepizero:~$ sudo cat /proc/device-tree/soc/spi@1c69000/status
disabledroberto@orangepizero:~$ sudo cat /proc/device-tree/soc/spi@1c68000/status
disabledroberto@orangepizero:~$

 

Finally, I am able to load the kernel module, but it does nothing:

Spoiler
roberto@orangepizero:~/ili9341_driver$ sudo modprobe ili9341
roberto@orangepizero:~/ili9341_driver$ dmesg|grep ili
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.014095] LSM: initializing lsm=capability,yama,apparmor,integrity
[   11.167573] systemd[1]: Listening on systemd-initctl.socket - initctl Compatibility Named Pipe.
roberto@orangepizero:~/ili9341_driver$ lsmod|grep ili
ili9341                12288  0
drm_mipi_dbi           20480  1 ili9341
roberto@orangepizero:~/ili9341_driver$

 

 

 

Now I am trying replacing "spi0_pi_pins" with "spi1_pins"...

New progress: spi1 is now enabled

Spoiler
roberto@orangepizero:~/ili9341_driver$ sudo cat /proc/device-tree/soc/spi@1c68000/status
[sudo] password for roberto: 
disabledroberto@orangepizero:~/ili9341_sudo cat /proc/device-tree/soc/spi@1c69000/status
okayroberto@orangepizero:~/ili9341_driver$
roberto@orangepizero:~/ili9341_drivsudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (PA1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (PA2): (MUX UNCLAIMED) 1c20800.pinctrl:2
pin 3 (PA3): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 4 (PA4): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA4
pin 5 (PA5): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PA5
pin 6 (PA6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (PA7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (PA8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (PA10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (PA11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (PA12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (PA13): 1c69000.spi 1c20800.pinctrl:13 function spi1 group PA13
pin 14 (PA14): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA14
pin 15 (PA15): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA15
pin 16 (PA16): 1c69000.spi (GPIO UNCLAIMED) function spi1 group PA16
pin 17 (PA17): (MUX UNCLAIMED) 1c20800.pinctrl:17
pin 18 (PA18): (MUX UNCLAIMED) 1c20800.pinctrl:18
pin 19 (PA19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (PA20): (MUX UNCLAIMED) 1c20800.pinctrl:20
pin 21 (PA21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
roberto@orangepizero:~/ili9341_driver$ modprobe ili9341
roberto@orangepizero:~/ili9341_driver$ lsmod|grep ili
ili9341                12288  0
panel_ilitek_ili9341    16384  0
drm_mipi_dbi           20480  2 ili9341,panel_ilitek_ili9341

 

When I tried this simplification of my DTS:

Spoiler
oberto@orangepizero:~/ili9341_driver$ cat ili9341-spi1.dts
/*
OrangePi Zero connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
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 = "PA18", "PA2"; /* DC pin and RESET pin */
                function = "gpio_out", "gpio_out";
            };
        };
	};
	fragment@1 {
        target = <&spi1>;
        __overlay__ {
            /* needed to avoid dtc warning */
            #address-cells = <1>;
            #size-cells = <0>;
            status="okay";
            cs-gpios = <&pio 0 13 0>; /* PA13 chip select */
            num-chipselects = <1>;
            display: display@0 {
                compatible = "adafruit,yx240qv29", "ilitek,ili9341";
                pinctrl-names = "default";
                pinctrl-0 = <&display_pins>;
                reg = <0>;
                spi-max-frequency = <8000000>;
                rotation = <270>;
                bgr = <0>;
                fps = <10>;
                buswidth = <8>;
                height = <240>;
                width = <320>;
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                dc-gpios = <&pio 0 18 0>; /* PA18 Data control pin */
                debug = <3>;
            };
        };
    };


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

 

Then, finally the ili9341.ko gets loaded at boot:

Spoiler
roberto@orangepizero:~/ili9341_driver$ dmesg|grep ili
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.014037] LSM: initializing lsm=capability,yama,apparmor,integrity
[   10.279561] systemd[1]: Listening on systemd-initctl.socket - initctl Compatibility Named Pipe.
[   13.998140] panel-ilitek-ili9341 spi0.0: get optional vcc failed
[   14.013966] [drm] Initialized ili9341 1.0.0 20210716 for spi0.0 on minor 2
[   14.025077] panel-ilitek-ili9341 spi0.0: [drm] fb1: ili9341drmfb frame buffer device
roberto@orangepizero:~/ili9341_driver$ lsmod|grep ili
ili9341                12288  0
panel_ilitek_ili9341    16384  0
drm_mipi_dbi           20480  2 ili9341,panel_ilitek_ili9341

 

But the dmesg is referring to spi0.0... and I need to use spi1.0. The TFT screen shows nothing. Is there another thing I can test?

 

Update: It seems that panel-ilitek-ili9341.ko is the part that wants to access spi0... is there any way to exhort it and use spi1?

driver c code in: https://codebrowser.dev/linux/linux/drivers/gpu/drm/panel/panel-ilitek-ili9341.c.html

 

Link to comment
Share on other sites

Hi robertoj,

 

Glad you are making some progress. I know it says spi0.0 in the log but really it is still pointing to spi1. To get the id in software to match the physical id we have to explicity assign. This is not critical and does not impact on actual function but if you want to set it to match to avoid confusion, this can be done by adding the following fragment to the overlay:

fragment@0 {
	target-path = "/aliases";
		__overlay__ {
			spi1 = "/soc/spi@01c69000";
	};
};

 

I see that the display is being mapped to /dev/fb1, from my experience it tends not to work unless mapped to /dev/fb0. You could try FRAMEBUFFER=/dev/fb1 and see if that triggers any sort of output. From what I tell can from the Sunxi wiki the Orange Pi Zero can provide composite ouput that appears to be enabled by default which would likely be mapped to /dev/fb0.

 

Best of luck

Ryzer

 

Edited by Ryzer
fix typo
Link to comment
Share on other sites

Thank you for the suggestions...

 

I rebuilt my armbian image for orangepi zero to linux 6.1.104, just to make it more similar to everyone else's setup

 

I had better success with your latest dts, with my spi1, and GPIO pin modifications, without doing the simplified version

 

On reboot, I tested that devices were configured well again: dmesg|grep ili, lsmod|grep ili, cat ...spi@1c69000/status, cat ...1c20800.pinctrl/pinmux-pins

 

Then, I executed:

 

apt install xinit xterm xauth x11-apps xserver-xorg lightdm
sudo su -
FRAMEBUFFER=/dev/fb1 startx

 

But my TFT stayed 100% white. Here is my xorg log

Spoiler

cat /var/log/Xorg.1.log
[    93.714]
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[    93.715] Current Operating System: Linux orangepizero 6.1.104-legacy-sunxi #1 SMP Sun Aug 11 10:36:02 UTC 2024 armv7l
[    93.715] Kernel command line: root=UUID=677917ab-5341-4634-b556-aafaeaa83c52 rootwait rootfstype=ext4 splash=verbose console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=320x240p15 consoleblank=0 loglevel=1 ubootpart=3a0c4e63-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
[    93.715] xorg-server 2:21.1.7-3+deb12u7 (https://www.debian.org/support)
[    93.715] Current version of pixman: 0.42.2
[    93.715]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    93.715] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    93.716] (==) Log file: "/var/log/Xorg.1.log", Time: Fri Aug 30 12:32:10 2024
[    93.718] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    93.719] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    93.728] (==) No Layout section.  Using the first Screen section.
[    93.728] (==) No screen section available. Using defaults.
[    93.728] (**) |-->Screen "Default Screen Section" (0)
[    93.728] (**) |   |-->Monitor "<default monitor>"
[    93.732] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[    93.733] (==) Automatically adding devices
[    93.733] (==) Automatically enabling devices
[    93.733] (==) Automatically adding GPU devices
[    93.733] (==) Automatically binding GPU devices
[    93.733] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    93.733] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    93.733]     Entry deleted from font path.
[    93.733] (==) FontPath set to:
    built-ins
[    93.733] (==) ModulePath set to "/usr/lib/xorg/modules"
[    93.733] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    93.733] (II) Loader magic: 0x650090
[    93.733] (II) Module ABI versions:
[    93.733]     X.Org ANSI C Emulation: 0.4
[    93.733]     X.Org Video Driver: 25.2
[    93.733]     X.Org XInput driver : 24.4
[    93.733]     X.Org Server Extension : 10.0
[    93.736] (--) using VT number 2

[    93.736] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    93.742] (II) xfree86: Adding drm device (/dev/dri/card0)
[    93.742] (II) Platform probe for /sys/devices/platform/display-engine/drm/card0
[    93.743] (II) xfree86: Adding drm device (/dev/dri/card2)
[    93.743] (II) Platform probe for /sys/devices/platform/soc/1c40000.gpu/drm/card2
[    93.745] (II) xfree86: Adding drm device (/dev/dri/card1)
[    93.745] (II) Platform probe for /sys/devices/platform/soc/1c69000.spi/spi_master/spi0/spi0.0/drm/card1
[    93.745] (II) no primary bus or device found
[    93.745]     falling back to /sys/devices/platform/display-engine/drm/card0
[    93.746] (II) LoadModule: "glx"
[    93.748] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    93.778] (II) Module glx: vendor="X.Org Foundation"
[    93.778]     compiled for 1.21.1.7, module version = 1.0.0
[    93.778]     ABI class: X.Org Server Extension, version 10.0
[    93.778] (==) Matched modesetting as autoconfigured driver 0
[    93.778] (==) Matched fbdev as autoconfigured driver 1
[    93.778] (==) Assigned the driver to the xf86ConfigLayout
[    93.778] (II) LoadModule: "modesetting"
[    93.780] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    93.783] (II) Module modesetting: vendor="X.Org Foundation"
[    93.783]     compiled for 1.21.1.7, module version = 1.21.1
[    93.784]     Module class: X.Org Video Driver
[    93.784]     ABI class: X.Org Video Driver, version 25.2
[    93.784] (II) LoadModule: "fbdev"
[    93.784] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    93.787] (II) Module fbdev: vendor="X.Org Foundation"
[    93.787]     compiled for 1.21.1.3, module version = 0.5.0
[    93.787]     Module class: X.Org Video Driver
[    93.787]     ABI class: X.Org Video Driver, version 25.2
[    93.787] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    93.787] (II) FBDEV: driver for framebuffer: fbdev
[    93.842] (II) modeset(0): using drv /dev/dri/card0
[    93.842] (WW) Falling back to old probe method for fbdev
[    93.842] (II) Loading sub module "fbdevhw"
[    93.842] (II) LoadModule: "fbdevhw"
[    93.842] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    93.845] (II) Module fbdevhw: vendor="X.Org Foundation"
[    93.845]     compiled for 1.21.1.7, module version = 0.0.2
[    93.845]     ABI class: X.Org Video Driver, version 25.2
[    93.846] (II) modeset(G0): using drv /dev/dri/card1
[    93.846] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    93.847] (II) modeset(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
[    93.847] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[    93.847] (==) modeset(0): RGB weight 888
[    93.847] (==) modeset(0): Default visual is TrueColor
[    93.847] (II) Loading sub module "glamoregl"
[    93.847] (II) LoadModule: "glamoregl"
[    93.848] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    93.894] (II) Module glamoregl: vendor="X.Org Foundation"
[    93.894]     compiled for 1.21.1.7, module version = 1.0.1
[    93.894]     ABI class: X.Org ANSI C Emulation, version 0.4
[    96.098] (II) modeset(0): glamor X acceleration enabled on Mali400
[    96.099] (II) modeset(0): glamor initialized
[    96.099] (==) modeset(0): VariableRefresh: disabled
[    96.099] (==) modeset(0): AsyncFlipSecondaries: disabled
[    96.100] (II) modeset(0): Output Composite-1 has no monitor section
[    96.101] (II) modeset(0): EDID for output Composite-1
[    96.101] (II) modeset(0): Printing probed modes for output Composite-1
[    96.101] (II) modeset(0): Modeline "PAL"x25.0   13.50  720 723 725 864  576 604 606 625 interlace (15.6 kHz e)
[    96.101] (II) modeset(0): Modeline "NTSC"x30.0   13.50  720 738 740 858  480 506 508 525 interlace (15.7 kHz e)
[    96.101] (II) modeset(0): Output Composite-1 connected
[    96.101] (II) modeset(0): Using sloppy heuristic for initial modes
[    96.101] (II) modeset(0): Output Composite-1 using initial mode PAL +0+0
[    96.101] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[    96.101] (==) modeset(0): DPI set to (96, 96)
[    96.101] (II) Loading sub module "fb"
[    96.101] (II) LoadModule: "fb"
[    96.101] (II) Module "fb" already built-in
[    96.102] (II) modeset(G0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 16/16
[    96.102] (==) modeset(G0): Depth 16, (==) framebuffer bpp 16
[    96.102] (==) modeset(G0): RGB weight 565
[    96.102] (==) modeset(G0): Default visual is TrueColor
[    96.102] (II) Loading sub module "glamoregl"
[    96.102] (II) LoadModule: "glamoregl"
[    96.102] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    96.102] (II) Module glamoregl: vendor="X.Org Foundation"
[    96.102]     compiled for 1.21.1.7, module version = 1.0.1
[    96.103]     ABI class: X.Org ANSI C Emulation, version 0.4
[    96.455] (II) modeset(G0): glamor X acceleration enabled on Mali400
[    96.456] (II) modeset(G0): glamor initialized
[    96.456] (II) modeset(G0): Output Unknown19-1 has no monitor section
[    96.457] (II) modeset(G0): EDID for output Unknown19-1
[    96.457] (II) modeset(G0): Printing probed modes for output Unknown19-1
[    96.457] (II) modeset(G0): Modeline "320x240"x0.0    0.00  320 320 320 320  240 240 240 240 (0.0 kHz eP)
[    96.457] (==) modeset(G0): Using gamma correction (1.0, 1.0, 1.0)
[    96.457] (==) modeset(G0): DPI set to (96, 96)
[    96.457] (II) Loading sub module "fb"
[    96.457] (II) LoadModule: "fb"
[    96.457] (II) Module "fb" already built-in
[    96.457] (II) UnloadModule: "fbdev"
[    96.457] (II) Unloading fbdev
[    96.458] (II) UnloadSubModule: "fbdevhw"
[    96.458] (II) Unloading fbdevhw
[    96.603] (==) modeset(0): Backing store enabled
[    96.603] (==) modeset(0): Silken mouse enabled
[    96.618] (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[    96.618] (==) modeset(0): DPMS enabled
[    96.619] (II) modeset(0): [DRI2] Setup complete
[    96.619] (II) modeset(0): [DRI2]   DRI driver: sun4i-drm
[    96.619] (II) modeset(0): [DRI2]   VDPAU driver: sun4i-drm
[    96.659] (==) modeset(G0): Backing store enabled
[    96.659] (==) modeset(G0): Silken mouse enabled
[    96.660] (II) modeset(G0): Initializing kms color map for depth 16, 6 bpc.
[    96.660] (==) modeset(G0): DPMS enabled
[    96.661] (II) modeset(G0): [DRI2] Setup complete
[    96.661] (II) modeset(G0): [DRI2]   DRI driver: ili9341
[    96.661] (II) modeset(G0): [DRI2]   VDPAU driver: ili9341
[    96.668] (II) Initializing extension Generic Event Extension
[    96.671] (II) Initializing extension SHAPE
[    96.673] (II) Initializing extension MIT-SHM
[    96.674] (II) Initializing extension XInputExtension
[    96.676] (II) Initializing extension XTEST
[    96.677] (II) Initializing extension BIG-REQUESTS
[    96.678] (II) Initializing extension SYNC
[    96.679] (II) Initializing extension XKEYBOARD
[    96.680] (II) Initializing extension XC-MISC
[    96.681] (II) Initializing extension SECURITY
[    96.682] (II) Initializing extension XFIXES
[    96.683] (II) Initializing extension RENDER
[    96.684] (II) Initializing extension RANDR
[    96.685] (II) Initializing extension COMPOSITE
[    96.686] (II) Initializing extension DAMAGE
[    96.687] (II) Initializing extension MIT-SCREEN-SAVER
[    96.688] (II) Initializing extension DOUBLE-BUFFER
[    96.689] (II) Initializing extension RECORD
[    96.690] (II) Initializing extension DPMS
[    96.691] (II) Initializing extension Present
[    96.692] (II) Initializing extension DRI3
[    96.693] (II) Initializing extension X-Resource
[    96.694] (II) Initializing extension XVideo
[    96.694] (II) Initializing extension XVideo-MotionCompensation
[    96.694] (II) Initializing extension SELinux
[    96.695] (II) SELinux: Disabled on system
[    96.695] (II) Initializing extension GLX
[    97.035] (II) AIGLX: Loaded and initialized sun4i-drm
[    97.036] (II) GLX: Initialized DRI2 GL provider for screen 0
[    97.036] (II) Initializing extension XFree86-VidModeExtension
[    97.037] (II) Initializing extension XFree86-DGA
[    97.038] (II) Initializing extension XFree86-DRI
[    97.039] (II) Initializing extension DRI2
[    97.042] (II) modeset(G0): Damage tracking initialized
[    97.043] (II) modeset(0): Damage tracking initialized
[    97.043] (II) modeset(0): Setting screen physical size to 190 x 152
[    98.187] (II) modeset(0): Disabling kernel dirty updates, not required.
[   146.667] (II) Server terminated successfully (0). Closing log file.

 

I was also doing tests with the DTS from https://ryjelsum.me/homelab/xpt2046-ili9341-opi-zero/

with a little better result: the TFT turns gray. The x11 server started with no errors, but the TFT stayed gray

Spoiler

cat /var/log/Xorg.1.log
[    86.066]
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[    86.066] Current Operating System: Linux orangepizero 6.1.104-legacy-sunxi #1 SMP Sun Aug 11 10:36:02 UTC 2024 armv7l
[    86.066] Kernel command line: root=UUID=677917ab-5341-4634-b556-aafaeaa83c52 rootwait rootfstype=ext4 splash=verbose console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=320x240p15 consoleblank=0 loglevel=1 ubootpart=3a0c4e63-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
[    86.067] xorg-server 2:21.1.7-3+deb12u7 (https://www.debian.org/support)
[    86.067] Current version of pixman: 0.42.2
[    86.067]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    86.067] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    86.068] (==) Log file: "/var/log/Xorg.1.log", Time: Fri Aug 30 11:59:51 2024
[    86.072] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    86.072] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    86.081] (==) No Layout section.  Using the first Screen section.
[    86.081] (==) No screen section available. Using defaults.
[    86.081] (**) |-->Screen "Default Screen Section" (0)
[    86.082] (**) |   |-->Monitor "<default monitor>"
[    86.086] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[    86.086] (==) Automatically adding devices
[    86.086] (==) Automatically enabling devices
[    86.086] (==) Automatically adding GPU devices
[    86.086] (==) Automatically binding GPU devices
[    86.086] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    86.086] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    86.086]     Entry deleted from font path.
[    86.086] (==) FontPath set to:
    built-ins
[    86.086] (==) ModulePath set to "/usr/lib/xorg/modules"
[    86.086] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    86.087] (II) Loader magic: 0x616090
[    86.087] (II) Module ABI versions:
[    86.087]     X.Org ANSI C Emulation: 0.4
[    86.087]     X.Org Video Driver: 25.2
[    86.087]     X.Org XInput driver : 24.4
[    86.087]     X.Org Server Extension : 10.0
[    86.090] (--) using VT number 2

[    86.090] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    86.093] (II) xfree86: Adding drm device (/dev/dri/card0)
[    86.093] (II) Platform probe for /sys/devices/platform/display-engine/drm/card0
[    86.094] (II) xfree86: Adding drm device (/dev/dri/card1)
[    86.095] (II) Platform probe for /sys/devices/platform/soc/1c40000.gpu/drm/card1
[    86.095] (II) no primary bus or device found
[    86.095]     falling back to /sys/devices/platform/display-engine/drm/card0
[    86.096] (II) LoadModule: "glx"
[    86.098] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    86.139] (II) Module glx: vendor="X.Org Foundation"
[    86.139]     compiled for 1.21.1.7, module version = 1.0.0
[    86.139]     ABI class: X.Org Server Extension, version 10.0
[    86.139] (==) Matched modesetting as autoconfigured driver 0
[    86.139] (==) Matched fbdev as autoconfigured driver 1
[    86.139] (==) Assigned the driver to the xf86ConfigLayout
[    86.139] (II) LoadModule: "modesetting"
[    86.142] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    86.146] (II) Module modesetting: vendor="X.Org Foundation"
[    86.146]     compiled for 1.21.1.7, module version = 1.21.1
[    86.146]     Module class: X.Org Video Driver
[    86.146]     ABI class: X.Org Video Driver, version 25.2
[    86.146] (II) LoadModule: "fbdev"
[    86.146] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    86.149] (II) Module fbdev: vendor="X.Org Foundation"
[    86.149]     compiled for 1.21.1.3, module version = 0.5.0
[    86.150]     Module class: X.Org Video Driver
[    86.150]     ABI class: X.Org Video Driver, version 25.2
[    86.150] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    86.150] (II) FBDEV: driver for framebuffer: fbdev
[    86.263] (II) modeset(0): using drv /dev/dri/card0
[    86.264] (WW) Falling back to old probe method for fbdev
[    86.264] (II) Loading sub module "fbdevhw"
[    86.264] (II) LoadModule: "fbdevhw"
[    86.264] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    86.267] (II) Module fbdevhw: vendor="X.Org Foundation"
[    86.267]     compiled for 1.21.1.7, module version = 0.0.2
[    86.267]     ABI class: X.Org Video Driver, version 25.2
[    86.268] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    86.268] (II) modeset(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
[    86.268] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[    86.269] (==) modeset(0): RGB weight 888
[    86.269] (==) modeset(0): Default visual is TrueColor
[    86.269] (II) Loading sub module "glamoregl"
[    86.269] (II) LoadModule: "glamoregl"
[    86.269] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    86.317] (II) Module glamoregl: vendor="X.Org Foundation"
[    86.317]     compiled for 1.21.1.7, module version = 1.0.1
[    86.317]     ABI class: X.Org ANSI C Emulation, version 0.4
[    87.979] (II) modeset(0): glamor X acceleration enabled on Mali400
[    87.979] (II) modeset(0): glamor initialized
[    87.979] (==) modeset(0): VariableRefresh: disabled
[    87.979] (==) modeset(0): AsyncFlipSecondaries: disabled
[    87.979] (II) modeset(0): Output Composite-1 has no monitor section
[    87.980] (II) modeset(0): EDID for output Composite-1
[    87.981] (II) modeset(0): Printing probed modes for output Composite-1
[    87.981] (II) modeset(0): Modeline "PAL"x25.0   13.50  720 723 725 864  576 604 606 625 interlace (15.6 kHz e)
[    87.981] (II) modeset(0): Modeline "NTSC"x30.0   13.50  720 738 740 858  480 506 508 525 interlace (15.7 kHz e)
[    87.981] (II) modeset(0): Output Composite-1 connected
[    87.981] (II) modeset(0): Using sloppy heuristic for initial modes
[    87.981] (II) modeset(0): Output Composite-1 using initial mode PAL +0+0
[    87.981] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[    87.981] (==) modeset(0): DPI set to (96, 96)
[    87.981] (II) Loading sub module "fb"
[    87.981] (II) LoadModule: "fb"
[    87.981] (II) Module "fb" already built-in
[    87.981] (II) UnloadModule: "fbdev"
[    87.981] (II) Unloading fbdev
[    87.982] (II) UnloadSubModule: "fbdevhw"
[    87.982] (II) Unloading fbdevhw
[    88.150] (==) modeset(0): Backing store enabled
[    88.150] (==) modeset(0): Silken mouse enabled
[    88.160] (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[    88.160] (==) modeset(0): DPMS enabled
[    88.161] (II) modeset(0): [DRI2] Setup complete
[    88.161] (II) modeset(0): [DRI2]   DRI driver: sun4i-drm
[    88.161] (II) modeset(0): [DRI2]   VDPAU driver: sun4i-drm
[    88.161] (II) Initializing extension Generic Event Extension
[    88.162] (II) Initializing extension SHAPE
[    88.163] (II) Initializing extension MIT-SHM
[    88.164] (II) Initializing extension XInputExtension
[    88.166] (II) Initializing extension XTEST
[    88.167] (II) Initializing extension BIG-REQUESTS
[    88.168] (II) Initializing extension SYNC
[    88.169] (II) Initializing extension XKEYBOARD
[    88.170] (II) Initializing extension XC-MISC
[    88.171] (II) Initializing extension SECURITY
[    88.172] (II) Initializing extension XFIXES
[    88.173] (II) Initializing extension RENDER
[    88.174] (II) Initializing extension RANDR
[    88.176] (II) Initializing extension COMPOSITE
[    88.177] (II) Initializing extension DAMAGE
[    88.178] (II) Initializing extension MIT-SCREEN-SAVER
[    88.179] (II) Initializing extension DOUBLE-BUFFER
[    88.180] (II) Initializing extension RECORD
[    88.181] (II) Initializing extension DPMS
[    88.182] (II) Initializing extension Present
[    88.182] (II) Initializing extension DRI3
[    88.183] (II) Initializing extension X-Resource
[    88.184] (II) Initializing extension XVideo
[    88.185] (II) Initializing extension XVideo-MotionCompensation
[    88.185] (II) Initializing extension SELinux
[    88.185] (II) SELinux: Disabled on system
[    88.185] (II) Initializing extension GLX
[    88.530] (II) AIGLX: Loaded and initialized sun4i-drm
[    88.531] (II) GLX: Initialized DRI2 GL provider for screen 0
[    88.531] (II) Initializing extension XFree86-VidModeExtension
[    88.532] (II) Initializing extension XFree86-DGA
[    88.533] (II) Initializing extension XFree86-DRI
[    88.534] (II) Initializing extension DRI2
[    88.537] (II) modeset(0): Damage tracking initialized
[    88.537] (II) modeset(0): Setting screen physical size to 190 x 152
[    88.806] (II) config/udev: Adding input device ADS7846 Touchscreen (/dev/input/event0)
[    88.807] (**) ADS7846 Touchscreen: Applying InputClass "libinput touchscreen catchall"
[    88.807] (II) LoadModule: "libinput"
[    88.807] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[    88.831] (II) Module libinput: vendor="X.Org Foundation"
[    88.831]     compiled for 1.21.1.3, module version = 1.2.1
[    88.831]     Module class: X.Org XInput Driver
[    88.831]     ABI class: X.Org XInput driver, version 24.4
[    88.831] (II) Using input driver 'libinput' for 'ADS7846 Touchscreen'
[    88.831] (**) ADS7846 Touchscreen: always reports core events
[    88.831] (**) Option "Device" "/dev/input/event0"
[    88.871] (II) event0  - ADS7846 Touchscreen: is tagged by udev as: Touchscreen
[    88.873] (II) event0  - ADS7846 Touchscreen: device is a touch device
[    88.874] (II) event0  - ADS7846 Touchscreen: device removed
[    88.904] (**) Option "config_info" "udev:/sys/devices/platform/soc/1c69000.spi/spi_master/spi0/spi0.1/input/input0/event0"
[    88.904] (II) XINPUT: Adding extended input device "ADS7846 Touchscreen" (type: TOUCHSCREEN, id 6)
[    88.905] (**) Option "AccelerationScheme" "none"
[    88.905] (**) ADS7846 Touchscreen: (accel) selected scheme none/0
[    88.905] (**) ADS7846 Touchscreen: (accel) acceleration factor: 2.000
[    88.905] (**) ADS7846 Touchscreen: (accel) acceleration threshold: 4
[    88.911] (II) event0  - ADS7846 Touchscreen: is tagged by udev as: Touchscreen
[    88.912] (II) event0  - ADS7846 Touchscreen: device is a touch device
[    89.714] (II) modeset(0): Disabling kernel dirty updates, not required.
[    96.841] (II) event0  - ADS7846 Touchscreen: device removed
[    96.881] (II) UnloadModule: "libinput"
[    96.963] (II) Server terminated successfully (0). Closing log file.

 

With either DTS, I see that there is no references to /dev/fb1, in xorg.log

 

I also tried "sudo con2fbmap 2 1", it didn't work

 

I am going to look for very old OS image ,where it is known to work with my SBC

Link to comment
Share on other sites

Hi robertoj,

 

Before you revert to an old image I would suggest one last thing. If the screen is grey then that is progress, xserver just has to be configured to use it. I encountered the exact same problem when trying to the display module working with the Raspberry PI as alternative option. Then I remembered that we need to create a configuration file. It needs to be saved to "/etc/X11/xorg.conf.d/". Call it something like 99-fbdev.conf and write the following:

Section "Device"
    Identifier "myfb"
    Driver "fbdev"
    Option "fbdev" "/dev/fb1"
EndSection

 

if you do 'sudo dmesg | grep drm' it will list all the display devices although we can also see the devices list in the xorg.log.

[    93.742] (II) Platform probe for /sys/devices/platform/display-engine/drm/card0
[    93.743] (II) xfree86: Adding drm device (/dev/dri/card2)
[    93.743] (II) Platform probe for /sys/devices/platform/soc/1c40000.gpu/drm/card2
[    93.745] (II) xfree86: Adding drm device (/dev/dri/card1)
[    93.745] (II) Platform probe for /sys/devices/platform/soc/1c69000.spi/spi_master/spi0/spi0.0/drm/card1

 

Even though it is not erroring, it is not finding a valid configuration so it switches back to the default display device which is normally the display engine.

[    93.745] (II) no primary bus or device found
[    93.745]     falling back to /sys/devices/platform/display-engine/drm/card0

 

All the best

Ryzer

 

Link to comment
Share on other sites

As a sanity check, I tried this positive experience, and my TFT is working for the first time :)

https://4pda.to/forum/index.php?showtopic=782242&st=5060#entry112401076  (using google translate)

I copied the 3 DTS in that forum post, used them, and the TFT showed a black screen, with login prompt

With linux 5.15.93, from Armbian_23.02.2_Orangepizero_jammy_current_5.15.93

 

I need to check what is being done here, and transfer it to my best experience with linux 6.1 or 6.6

 

quick check: sudo fbi -noverbose -a -t 10 -T 2 -d /dev/fb0 mafalda.jpg

orangepizero-mafalda.jpeg

 

That spi_ili9341.dts in the 4pda forum works for orangepi zero, linux 6.1.104, although it only uses fb_ili9341, not the drm driver.

 

ALSO: when I remove "tve" (NTSC) from the overlays, there's only /dev/fb0 (not fb1), which is the TFT LCD, and the boot messages appear in the LCD

 

When I edit my DTS to look more like the "viroid" DTS, when in Linux 6.1.104, the TFT stays 100% white.

Then, when I remove the "adafruit,yx240qv29", it works again

 

Someone with a similar problem: https://forums.raspberrypi.com/viewtopic.php?t=358240#p2165609

https://github.com/notro/tinydrm/issues/14

 

i will try with a newer kernel, maybe the driver improved

Link to comment
Share on other sites

I tried kernel 6.6 and I only have luck with fb_ili9341, not ili9341 (adafruit’s drm driver)


Is it drm_mipi_dbi.ko the part that actually handles the SPI port? Is there a manual to see the parameters, or a log file?

 

i will include armbian-monitor -u soon

 

my findings are in my thread https://forum.armbian.com/topic/44191-orangepi-zero-lts-ili9341-tft-lcd-and-later-orangepi-zero-3/

 

 

To those who are enjoying a drm screen in their ili9341, are you also getting h264 acceleration? Are you also getting the touch events with a second chip select?

 

Why do some DTS have this (in bold) part in their fragment0 (Ryzer May 30, 2023), and later versions of the DTS don't have that part?

 

Spoiler

fragmen@0 {

    target = <&pio>;

    __overlay__ {

        display_pins: display_pins {

            pins = "PI11", "PI12";

            function = "gpio_out";

        };

        display_cs_pin: display_cs_pin {

            pins = "PB2";

            function = "gpio_out";

            output-high;

        };

    };

};

 

Well, I tried this DTS and I have the same result: white TFT

Spoiler
/*
OrangePi Zero -> ILI9341 LCD connections
SPI CLOCK = PA14
SPI DO (LCD MISO) = PA16 (OPIZ MISO)
SPI DI (LCD MOSI) = PA15 (OPIZ MOSI)
LCD DATA/CONTROL = PA18
LCD RESET = PA2
CHIP SELECT = PA13
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__{
                spi1_cs0: spi1_cs0 {
                    pins = "PA13"; 
                    function = "gpio_out";
                    output-high;
                };
	        display_pins: display_pins {
                    pins = "PA18", "PA2"; /* reset, DC pins, order does not matter*/
                    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";
            cs-gpios = <&pio 0 13 0>;  /* PA13 chip select */
            num-chipselects = <1>;
            display: display@0 {
                pinctrl-1 = <&spi1_cs0>; /* Mux the PI to make sure they are set in spi Mode */
                reg = <0>;
                compatible = "adafruit,yx240qv29","ilitek,ili9341";
                /*compatible = "ilitek,ili9341";*/
                spi-max-frequency = <40000000>;
                status="okay";
                pinctrl-names = "default";
                pinctrl-0 = <&display_pins>;
                rotation = <270>; /* rotate for ili9341, rotation for yx240qv29 */
                bgr=<0>;
                fps = <15>;
                buswidth = <8>;
                height = <320>;
                width = <240>;
                dc-gpios = <&pio 0 18 0>; /* PA18 Data control pin */
                reset-gpios = <&pio 0 2 1>; /* PA2 reset pin*/
                debug = <4>;
                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";
    };
};

 

 

Link to comment
Share on other sites

Hi robertoj

 

Glad you found a solution that works. Just be mindful that the fb tft based drivers such as fb_ili9341 are no longer actively maintained and likely to be removed in future. I dont know the full details but just a brief overview of things are supposed to work. The underlying spi hardware will always be controlled by the spi controller driver as defined in the main SOC dtsi file which then exchanges information with the display driver at the other end which in our case is the ili9341. drm_mipi_dbi is a dependance of the ili9341. Again I dont know its exact function but I imagine its something to do with configure the resoution of the display as it can also be used to define a custom display as well. Looking at spi-max-frequency this appears to be set to high, it should be no greater than 24MHz. Getting h264 may be possible but it depends on the display data from the display engine being able to be sent spi controller. It should be but you will need to check in and figure out which input device relates to the ADS7846 touch controller.

 

All the best

Ryzer

Link to comment
Share on other sites

Thank you :)

 

I just got a banana pi m2 zero and I am trying to get the ili9341 working with the drm driver. What is the latest Linux it is known to work?

 

please share DST and pin connections :)

 

I got my ili9341 LCD working in Linux 5.13.12, with this DTS... and I still can't use the drm-enabled driver

Spoiler
/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 = "PC4", "PA2";
function = "gpio_out", "gpio_out";
};
};
};

fragment@1 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
status="okay";
cs-gpios = <&pio 2 3 0>; /* C3 */
num-chipselects = <1>;
display: display@0 {
compatible = "ilitek,ili9341";
/*compatible = "adafruit,yx240qv29", "ilitek,ili9341";*/
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&display_pins>;
spi-max-frequency = <40000000>;
rotate= <270>;
bgr = <0>;
fps = <15>;
buswidth = <8>;
height = <320>;
width = <240>;
reset-gpios = <&pio 2 4 1>; /* C4,GPIO 24 */
dc-gpios    = <&pio 0 2 0>; /* A2,GPIO 25 */
debug = <3>;
};
};
};



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

 

Notice that I needed to swap height=320 and width=240, or else I get garbled display. It is working fine with 40 MHz..

The connections are the same as show in the post from June 2, 2023

 

image.thumb.jpeg.dbfc3c6d5496abd54a6800683e4591ca.jpeg

Link to comment
Share on other sites

When I changed the DTS lines from:

 

compatible = "ilitek,ili9341";

reset-gpios = <&pio 2 4 1>; /* C4,GPIO 24 */

rotate = 270

 

to

 

compatible = "adafruit,yx240qv29", "ilitek,ili9341";

reset-gpios = <&pio 2 4 0>; /* C4,GPIO 24 */

rotation = 90

 

Reminder: this DTS is for the banana pi m2 zero, showing the whole DTS in the post above. It is working in LInux 6.6.44, Debian Bookworm Minimal

 

The LCD started working with the new ili9341 driver. My last mistake was not changing the reset pin high/low polarity

 

There is no "video tearing" when playing a 240p video, as it did with fb_ili9341. And the CPU load is 25% of one core, same as with the old driver.

 

mplayer -vo fbdev2:/dev/fb0 videofile.mp4

or

mpv --vo=drm --drm-connector=1.SPI-1 videofile.m4v <-causes 25% cpu load in 4 cores

 

image.thumb.jpeg.5a9c3dc28337456c3ff17b62431ad860.jpeg

 

Has anybody progressed in making the touch feature work?

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

Important Information

Terms of Use - Privacy Policy - Guidelines