Jump to content

Orange Pi Lite. problem with latest firmware.


Recommended Posts

Good afternoon.

I don't know how to solve a small problem.

There is Orange Pi Lite. It runs its own program. The program uses spi-dev and display.

You need to compile drivers for the network card. And then a problem arose.

I cannot install linux-headers-current-sunxi on a working distribution (the latest one available on the website Armbian_23.02.2  5.15.93 ).

And if you set “Community maintained”, then it is impossible to enable spi-dev and the display (Arbian-Config is missing in the repository)

How to solve this problem?

Link to comment
Share on other sites

3 hours ago, AlexTransit said:

Arbian-Config is missing in the repository

 

apt install armbian-config

 

Link to comment
Share on other sites

Quote

apt install armbian-config

thanks for the hint.
Arbian-Config is missing in the repository
 

OPILite
Welcome to Armbian_community 24.5.0-trunk.540 Bookworm with Linux 6.6.30-current-sunxi

$ sudo apt list "armbian-*"
Listing... Done
armbian-bsp-cli-orangepilite-current/now 24.5.0-trunk.540 armhf [installed,local]
armbian-firmware/now 24.5.0-trunk.540 all [installed,local]
$ uname -a
Linux vm00 6.6.30-current-sunxi #1 SMP Thu May  2 14:32:50 UTC 2024 armv7l GNU/Linux

 

Tomorrow I'll try to compile dts into dtb and register it in overlay manually.
I'll write about the results

Link to comment
Share on other sites

Did not work out

 

sudo dtc -@ -I dts -O dtb -o /boot/overlay-user/st7789.dtbo st7789.dts

added user_overlays=st7789 to /boot/armbianEnv.txt

 

after a reboot the log constantly writes

May 10 08:18:48 vm00 kernel: fb_st7789v spi0.1: fbtft_update_display: write_vmem failed to update display buffer
May 10 08:18:48 vm00 kernel: fb_st7789v spi0.1: write() failed and returned -22
May 10 08:18:48 vm00 kernel: fb_st7789v spi0.1: write() failed and returned -22

Probably dts running on the previous firmware is not suitable for this one.

my knowledge is not enough

i use one spi for external device and for display

spi-dev uses cs=0
display uses cs=1

 

Spoiler
/dts-v1/;
/plugin/;

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

    fragment@0 {
      target = <&pio>;
      __overlay__ {
        st7789v_pins: st7789v_pins {
          pins = "PA8", "PA9", "PA10";
          function = "gpio_out", "gpio_out", "gpio_out";
        };
      };
    };

    fragment@1 {
      target = <&spi0>;
      __overlay__ {
                #address-cells = <1>;
                #size-cells = <0>;
        status = "okay";
        cs-gpios = <0>,<&pio 0 20 0>;  /*cs0=no change, cs1=20 (PA20) */

        st7789v: st7789v@0 {
          compatible = "sitronix,st7789v";
          reg = <1>; /* use cs1 */
          pinctrl-names = "default";
          pinctrl-0 = <&st7789v_pins>;
          rotate = <0>;
          fps = <25>;
          buswidth = <8>;
          reset-gpios = <&pio 0 10 1>;
          dc-gpios = <&pio 0 9 0>;
          led-gpios = <&pio 0 8 0>;
          debug = <0>;
        };
      };
    };
  };

 

 

 

 

Link to comment
Share on other sites

checked in detail.
spi-dev - it works (in the new firmware)

gpio - it works

key the path by name is different ( /dev/input/by-path/platform-gpio-keys-event )

 

I haven't been able to launch the display on spi0.1 yet

Link to comment
Share on other sites

I found out what the problem was.

in the st7789v driver. need to indicate something. that I don’t know.

 

$ uname -a
Linux vm00 6.6.30-current-sunxi #1 SMP Thu May  2 14:32:50 UTC 2024 armv7l GNU/Linux

 

I connected ili9341 - everything works.

initialized the controller via DTS - works.

I'll try to launch st7789v through custom initialization

I'll write about the results

 

PS there were already problems with the st7789v driver on kernel 5.4 (initialized incorrectly)

on kernel 6.6 there are also some problems. :)

 

Link to comment
Share on other sites

solved.
the display on the ST7789V use spi0.1

spidev use spi0.0

 

Could not run on the built-in driver. I get

st7789v spi0.1: error -EINVAL: Failed to setup spi
fb_st7789v spi0.1: write() failed and returned -22

 

did the ST7789V initialization manually

 

/dts-v1/;
/plugin/;

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

    fragment@0 {
      target = <&pio>;
      __overlay__ {
        st7789v_pins: st7789v_pins {
          pins = "PA8", "PA9", "PA10", "PA20";
          function = "gpio_out", "gpio_out", "gpio_out", "gpio_out";
        };
      };
    };

    fragment@1 {
      target = <&spi0>;
      __overlay__ {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";
        cs-gpios = <&pio 2 3 1>,<&pio 0 20 1>;

        spidev@0 {
                compatible = "armbian,spi-dev";
                reg = <0>;
                spi-max-frequency = <1000000>;
        };

        display: display@1 {
/*          compatible = "sitronix,st7789v"; */
          compatible = "samsung,s6d02a1";
          reg = <1>; /* use cs1. required 1 in section display@1 */
          pinctrl-names = "default";
          pinctrl-0 =<&st7789v_pins>;
          spi-max-frequency = <16000000>;
          rotate = <180>;  /* in init rotate 0x1000036 0xXX 0(XX=00) 90(XX=a0) 180(XX=36 c0) 270(XX=60) */
          width = <240>;
          height = <320>;
          spi-cpol;
          buswidth = <8>;
          txbuflen = <153600>;
          reset-gpios = <&pio 0 10 1>;
          dc-gpios = <&pio 0 9 0>;
          led-gpios = <&pio 0 8 0>;
          debug = <0>;
          init = <
            0x1000001
            0x2000096

            0x1000011
            0x100003a 0x05
            0x10000b2 0x05 0x05 0x00 0x33 0x33
            0x10000b7 0x75
            0x10000c2 0x01 0xff
            0x10000c3 0x13
            0x10000c4 0x20
            0x10000bb 0x22
            0x10000c5 0x20
            0x10000d0 0xa4 0xa1
            0x1000029
            0x1000021
            0x1000036 0xc0
            0x100002a 0x00 0x00 0x00 0xef
            0x100002b 0x00 0x00 0x01 0x3f
            0x100002c
            0x10000e0 0xd0 0x05 0x0a 0x09 0x08 0x05 0x2e 0x44 0x45 0x0f 0x17 0x16 0x2b 0x33
            0x10000e1 0xd0 0x05 0x0a 0x09 0x08 0x05 0x2e 0x43 0x45 0x0f 0x16 0x16 0x2b 0x33
            0x2000064
          >;
        };
      };
    };
  };

 

 

everything works perfectly.

PS I don't know how to fix the topic header. problem solved

 

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