Jump to content

Recommended Posts

Posted

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";

};

};

 

 

 

 

 

Posted

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 */

Expand  

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.

 

 

 

Posted

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:

Posted

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.

 

Posted

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.

Posted (edited)

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
Posted

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

Posted

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

Posted

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

 

 

 

 

Posted

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

Posted

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! :)

Posted

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

Posted

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 :)

Posted

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

Posted

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

 

  Reveal hidden contents

 

and my armbianEnv.txt

  Reveal hidden contents

 

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

  Reveal hidden contents

 

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

Posted

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

Posted

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)

Posted

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

 

I added the DTS again:

  Reveal hidden contents

 

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:

  Reveal hidden contents

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

  Reveal hidden contents

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

  Reveal hidden contents

 

 

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

New progress: spi1 is now enabled

  Reveal hidden contents

When I tried this simplification of my DTS:

  Reveal hidden contents

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

  Reveal hidden contents

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

 

Posted (edited)

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
Posted

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

  Reveal hidden contents

 

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

  Reveal hidden contents

 

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

Posted

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

 

Posted

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

Posted

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?

 

  Reveal hidden contents

 

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

  Reveal hidden contents

 

Posted

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

Posted

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

  Reveal hidden contents

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

Posted

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?

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.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines