Jump to content

spender

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by spender

  1. /*
     * Device Tree overlay for ILI9341 LCD

     */

    /*

     * wire link:

     * ILI9341_PIN#      NanoPI-NEO_PIN#

     * SCK        <--->  23 GPIOC2

     * SDI/MOSI   <--->  19 GPIOC0

     * SDO/MISO   <--->  21 GPIOC1 

     * CS         <--->  24 gpioC3 spi0_pins 

     * DC/RS      <--->  22 GPIOA1

     * RESET      <--->  7  GPIOG11

     * VCC        <--->  4

     * GND        <--->  6

     * LED        <--->  12 GPIOA6

     *

     * Device Tree overlay for ili9341 2.2inch TFT LCD

     * 5.x 内核

     */

    /dts-v1/;

    /plugin/;

    / {

            compatible = "allwinner,sun8i-h3";

     

            fragment@0 {

                    target = <&spi0>;

                    __overlay__ {

                            status = "okay";

                    };

            };

     

            fragment@1 {

                    target = <&pio>;

                    __overlay__ {

                            spi0_cs_pins: spi0_cs_pins {

                                    pins = "PC3";

                                    function = "gpio_out";

                            };

     

                            opiz_display_pins: opiz_display_pins {

                    pins = "PA1", "PG11", "PA6";

                    function = "gpio_out";

                            };

                    };

            };

     

            fragment@2 {

                    target = <&spi0>;

                    __overlay__ {

                            /* needed to avoid dtc warning */

                            #address-cells = <1>;

                            #size-cells = <0>;

                            pinctrl-0=<&spi0_pins &spi0_cs_pins>;

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

     

                            opizdisplay: opiz-display@0{

                                    compatible = "ilitek,ili9341";

                                    reg = <0>;  /* Chip Select 0 */

                                    pinctrl-names = "default";

                                    pinctrl-0 = <&opiz_display_pins>;

     

                                    spi-max-frequency = <32000000>;

                                    rotate = <90>;

                                    bgr = <0>;

                                    fps = <33>;

                                    buswidth = <8>;

                                    dc-gpios = <&pio 0 1 0>;     /* PIN_22  GPIOA1 */

                                    reset-gpios = <&pio 6 11 1 >; /* PIN_7  GPIOG11 */

                                    led-gpios=<&pio 0 6 0>;      /* PIN_12  GPIOA6 */

                                    debug=<4>;

                                    status="okay";

                            };

                    };

            };

    };

     

    image.png

  2. Hello, I also tried to use the mainline(5.8.14) to drive my ILI9341 screen. I tried to write an overlay (see attachment) and added a similar description to the booted armbianEnv.txt. My current situation is: the screen is on but not displaying Any content. Can you check it for me? My cable connection method is as follows:

    ILI9341                     NanoPI_NEO Pin#

    SCK     --------------- 23

    SCI/MOSI ----------- 19

    SDO/MISO ---------- 21

    CS  -------------------- 24

    DC/RS ----------------13  [GPIOA2 ]

    RESET --------------- 11 [ GPIOA0 ]

    VCC ------------------ 4(5V)

    GND ------------------ 6

    LED --------------------15 [GPIOA3]

     

    This is my overlay source:

     

    /dts-v1/;
    /plugin/;
    / {
            compatible = "allwinner,sun8i-h3";
    
            fragment@0 {
                    target = <&spi0>;
                    __overlay__ {
                            status = "okay";
                    };
            };
    
            fragment@1 {
                    target = <&pio>;
                    __overlay__ {
                            opiz_display_pins: opiz_display_pins {
                    pins = "PA0", "PA2", "PA3"; 
                    function = "gpio_out";
                            };
                    };
            };
    
            fragment@2 {
                    target = <&spi0>;
                    __overlay__ {
                            /* needed to avoid dtc warning */
                            #address-cells = <1>;
                            #size-cells = <0>;
    
                            opizdisplay: opiz-display@0{
                                    compatible = "ilitek,ili9341";
                                    reg = <0>;  /* Chip Select 0 */
                                    pinctrl-names = "default";
                                    pinctrl-0 = <&opiz_display_pins>;
    
                                    spi-max-frequency = <32000000>;
                                    rotate = <90>;
                                    bgr = <0>;
                                    fps = <33>;
                                    buswidth = <8>;
                                    reset-gpios = <&pio 0 0 1 >; /* PIN_11  GPIOA0 */
                                    dc-gpios = <&pio 0 2 0>;     /* PIN_13  GPIOA2 */
                                    led-gpios=<&pio 0 3 0>;      /* PIN_15  GPIOA3 */
                                    debug=<4>;
                                    status="okay";
                            };
                    };
            };
    };

     

    This is my "armbianEnv.txt"

    verbosity=1
    bootlogo=false
    console=serial
    disp_mode=1920x1080p60
    overlay_prefix=sun8i-h3
    overlays=cir spi-spidev usbhost1 usbhost2
    rootdev=UUID=56420990-38dc-4f7e-a480-72cf6af39e27
    rootfstype=ext4
    user_overlays=sun8i-h3-I2S-out sun8i-h3-ili9341-v3
    usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

     

    And dmesg | grep spi, output:

    [   11.955745] fb_ili9341 spi0.0: fbtft_property_value: buswidth = 8
    [   11.955766] fb_ili9341 spi0.0: fbtft_property_value: debug = 1
    [   11.955774] fb_ili9341 spi0.0: fbtft_property_value: rotate = 90
    [   11.955785] fb_ili9341 spi0.0: fbtft_property_value: fps = 33
    [   11.956170] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'reset' GPIO
    [   11.956211] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'dc' GPIO
    [   11.956251] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'rd' GPIO
    [   11.956300] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'wr' GPIO
    [   11.956348] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'cs' GPIO
    [   11.956374] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'latch' GPIO
    [   11.956420] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    <font color=red>repeate n times</font>
    [   11.956478] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956523] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956550] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956575] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956611] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956647] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956699] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956725] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956749] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956776] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956799] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956823] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956848] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956871] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956898] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956922] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.956945] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.956968] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.956993] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.957017] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.957041] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    [   11.957065] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO
    [   11.957088] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO
    [   11.957111] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO
    <a font=red>end of repeat</a>
    [   12.263909] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=35, spi0.0 at 32 MHz

     

     

    Now, only backlight is white. no any information on screen.

    please help me!

     

  3. Do like this:    so easy! on 5.8 kernel

    1:  exec: armbian-config --->system--->hardware, open irc

    2: dmesg while found ir device, and build device file on /dev/lirc0

    3: install lirc application

    4: configure , move /etc/lirc/lircd.conf.d/devinput.lircd.conf to /etc/lirc/lircd.conf.d/devinput.lircd.conf-dist

    5: use irrecord to build a remote contrel coding file, and put it to dir: /etc/lir/lircd.conf.d, do: systemctl restart lircd

    6: irw try to use it.(If press key no output, do step 5 agaen. may be you need "ir-keytable -p xxx" set your protocol) 

    7: configure irexec , and exex it on daemon mode!  OK!   

     

    I used lirc for "mpc command", and write a simplay script control music play!

  4. After several days of study, I know that the new kernel version has cancelled the fbtft_device.ko method to drive fbtft, and changed it to the DT method. I also learned about the pinctrl subsystem, and tried to write an overlay by myself. After loading, the kernel has been found SPI device. The screen still doesn’t light up after the device is turned off. I don’t know the reason. I’m still looking for it. Can you help me?

    dmesg output :

    [   12.229733] [drm] Initialized ili9341 1.0.0 20180514 for spi0.0 on minor 0
    [   12.706426] ili9341 spi0.0: fb0: ili9341drmfb frame buffer device

    This is my overlay file, with DT fs check is OK!

    /dts-v1/;
    /plugin/;
    / {
            compatible = "allwinner,sun8i-h3";
    
            fragment@0 {
                    target = <&spi0>;
                    __overlay__ {
                            status = "okay";
                            spidev {
                                    compatible = "adafruit,yx240qv29", "ilitek,ili9341";
                                    reg = <0>;
                                    spi-max-frequency = <32000000>;
                                    txbuflen = <32768>;
                                    rotate = <90>;
                                    fps = <33>;
                                    bgr = <0>;
                                    buswidth = <8>;
                                    dc-gpios = <&pio 0 2 1>;         /* PA2 pin13 */
                                    reset-gpios = <&pio 0 0 1>;  /* PA0 pin11 */
                                    led-gpios = <&pio 0 3 1>;        /* PA3 pin15 */
                                    debug = <0>;
                                    status="okay";
                            };
                    };
            };
    };

    The Dupont wire connection method just like:

     * wire link:

     * ILI9341_PIN#      NanoPI-NEO_PIN#

     * SCK        <--->  23 GPIOC2

     * SDI/MOSI   <--->  19 GPIOC0

     * SDO/MISO   <--->  21 GPIOC1 

     * CS         <--->  24 [linux gpio=67] gpioC3 

     * DC/RS      <--->  13 [linux gpio=2] GPIOA2

     * RESET      <--->  11 [linux gpio=0] GPIOA0

     * VCC        <--->  4

     * GND        <--->  6

     * LED        <--->  15 [linux gpio=3] GPIOA3

     

  5. Thanks again! There is a new knowledge point! Identified as not modifying dtb.
    Now I am trying to add an ILI9341 screen to IT. Since the new kernel no longer supports fbtft_device.ko, it is modified to be defined by DT in dtb. I don't know yet. I am learning how to learn overlay to revise, just like this pcm5102a. If you don’t understand, try to add it yourself. If it is really unclear, I will post for help! enjoy working!

    20201018155708.jpg

  6. I  want a digital music player base on NanoPi NEO,  with device PCM5102A I2S sound card build.

    here is my pross: 

    1: Kernel: uname -a
    Linux nanopineo 5.8.14-sunxi #trunk SMP Sun Oct 11 18:51:16 CST 2020 armv7l armv7l armv7l GNU/Linux

     

    2: build u-boot and kernel with armbian--build , and It is passed, so wirite the IMG file to sd card!.

     

    3: I use command dtc to conver dtb to source, and chang I2S, SPI0, IR0,CODEC
    i2s@1c22000 ---->okay
    codec@1c22c00 --->okay
    spi@1c68000 --->okay
    ir@1f02000 --->okay
    from 'disable' to 'okay', 
    filename="sun8i-h3-nanopi-neo_OK-IR-I2S-SPI0.dts". and then build to "sun8i-h3-nanopi-neo.dtb", and copy to /boot/dtb directory.  

     

    4: I use 'armbian-add-overly  ./sun8i-h3-nanopi-neo_OK-IR-I2S-SPI0.dts' to create a user dtbo file, and reboot whth in /boot/armbinEnv.txt

     

    5: file pcm5102 has been created successfuly.
    root@nanopineo:~# ls -l /lib/modules/5.8.14-sunxi/kernel/sound/soc/codecs/snd-soc-pcm5102a.ko 
    -rw-r--r-- 1 root root 6733 Oct 11 18:51 /lib/modules/5.8.14-sunxi/kernel/sound/soc/codecs/snd-soc-pcm5102a.ko

     

    6: Now, /dev/lirc0, /dev/spidev0.0,  /dev/snd build ok!
    root@nanopineo:~# ls /dev/sp*
    /dev/spidev0.0
    root@nanopineo:~# ls /dev/s*
    /dev/spidev0.0  /dev/stderr  /dev/stdin  /dev/stdout

    /dev/shm:

    /dev/snd:
    by-path  controlC0  pcmC0D0c  pcmC0D0p  seq  timer


    7: aplay info:
     aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0

     

    8: dmesg info:
    [    3.630710] debugfs: Directory '1c22c00.codec' with parent 'H3 Audio Codec' already present!
    [    3.632908] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
    [   11.555242] cedrus 1c0e000.video-codec: Device registered as /dev/video0

     

    9: but when I play a mp3 music, report error:
    --------- play report -------------
    play WARN alsa: can't encode 0-bit Unknown or not applicable
    play FAIL formats: no handler for file extension `mp3'
    ----------mplayer report:----------------
    AO: [pulse] Init failed: Connection refused
    Failed to initialize audio driver 'pulse'
    AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)

    9: small TFT driver fb_ili9341 call method has change, fbtft_device is not exist with this versin, so, I turn on it is a long way!!

    10, PCM5102A work error! where is error ??? help !  I have a long way .

  7. I had build armbian 3 days ago, kernel ="5.8.13", with NanopiNEO, I want use a TFT screen, type is ILI9341, when I use "armbian-config" open spi_spidev, no /dev/spi* created, and screen does not work. here is config:

    #

    # cat /etc/modprobe.d/fbtft.conf
    options fbtft
    options fb_ili9341 name=fb_ili9341 gpios=rest:0,cs:67,dc:2,led:3 speed=48000000 fps=26 rotate=90 bgr=1 txbuflen=65536 debug=3
    

    here is armbian-hardware-monitor.log

     

    Other:  ttyS0 can't login, 

     

    Does somebody can help me, thinks very much!

     

    armbian-hardware-monitor.log

  8. Here is Debug information:

     

    # cd /lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft
    root@nanopineo:/lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft#
    modinfo fbtft_device
    filename:       /lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft/fbtft_device.ko
    license:        GPL
    author:         Noralf Tronnes
    description:    Add a FBTFT device.
    depends:        fbtft
    staging:        Y
    intree:         Y
    name:           fbtft_device
    vermagic:       4.19.84-sunxi SMP mod_unload ARMv7 thumb2 p2v8
    parm:           name:Devicename (required). name=list => list all supported devices. (charp)
    parm:           rotate:Angle to rotate display counter clockwise: 0, 90, 180, 270 (uint)
    parm:           busnum:SPI bus number (default=0) (uint)
    parm:           cs:SPI chip select (default=0) (uint)
    parm:           speed:SPI speed (override device default) (uint)
    parm:           mode:SPI mode (override device default) (int)
    parm:           gpios:List of gpios. Comma separated with the form: reset:23,dc:24 (when overriding the default, all gpios must be specified) (charp)
    parm:           fps:Frames per second (override driver default) (uint)
    parm:           gamma:String representation of Gamma Curve(s). Driver specific. (charp)
    parm:           txbuflen:txbuflen (override driver default) (int)
    parm:           bgr:BGR bit (supported by some drivers). (int)
    parm:           startbyte:Sets the Start byte used by some SPI displays. (uint)
    parm:           custom:Add a custom display device. Use speed= argument to make it a SPI device, else platform_device (bool)
    parm:           width:Display width, used with the custom argument (uint)
    parm:           height:Display height, used with the custom argument (uint)
    parm:           buswidth:Display bus width, used with the custom argument (uint)
    parm:           init:Init sequence, used with the custom argument (array of short)
    parm:           debug:level: 0-7 (the remaining 29 bits is for advanced usage) (ulong)
    parm:           verbose:0 silent, >0 show gpios, >1 show devices, >2 show devices before (default=3) (uint)


    root@nanopineo:/lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft# modprobe fbtft_device name=list
    modprobe: ERROR: could not insert 'fbtft_device': Operation canceled

    root@nanopineo:/lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft# dmesg|grep fbtft
    [16009.687584] fbtft_device: Supported displays:
    [16009.687599] fbtft_device: adafruit18
    [16009.687605] fbtft_device: adafruit18_green
    [16009.687610] fbtft_device: adafruit22
    [16009.687614] fbtft_device: adafruit22a
    [16009.687620] fbtft_device: adafruit28
    [16009.687625] fbtft_device: adafruit13m
    [16009.687629] fbtft_device: lm560g   <- This my ssd1322 driver name, and build can create a file , named "fb_ssd1322.ko"
    [16009.687634] fbtft_device: admatec_c-berry28
    [16009.687639] fbtft_device: agm1264k-fl
    [16009.687644] fbtft_device: dogs102
    [16009.687649] fbtft_device: er_tftm050_2
    [16009.687654] fbtft_device: er_tftm070_5
    [16009.687659] fbtft_device: ew24ha0
    [16009.687663] fbtft_device: ew24ha0_9bit
    [16009.687668] fbtft_device: flexfb
    [16009.687673] fbtft_device: flexpfb
    [16009.687678] fbtft_device: freetronicsoled128
    [16009.687683] fbtft_device: hx8353d
    [16009.687688] fbtft_device: hy28a
    [16009.687693] fbtft_device: hy28b
    [16009.687698] fbtft_device: ili9481
    [16009.687703] fbtft_device: itdb24
    [16009.687707] fbtft_device: itdb28
    [16009.687712] fbtft_device: itdb28_spi
    [16009.687717] fbtft_device: mi0283qt-2
    [16009.687722] fbtft_device: mi0283qt-9a
    [16009.687727] fbtft_device: mi0283qt-v2
    [16009.687732] fbtft_device: nokia3310
    [16009.687737] fbtft_device: nokia3310a
    [16009.687742] fbtft_device: nokia5110
    [16009.687747] fbtft_device: piscreen
    [16009.687751] fbtft_device: pitft
    [16009.687756] fbtft_device: pioled
    [16009.687761] fbtft_device: rpi-display
    [16009.687766] fbtft_device: s6d02a1
    [16009.687771] fbtft_device: sainsmart18
    [16009.687776] fbtft_device: sainsmart32
    [16009.687781] fbtft_device: sainsmart32_fast
    [16009.687786] fbtft_device: sainsmart32_latched
    [16009.687791] fbtft_device: sainsmart32_spi
    [16009.687796] fbtft_device: spidev
    [16009.687801] fbtft_device: ssd1331
    [16009.687806] fbtft_device: tinylcd35
    [16009.687811] fbtft_device: tm022hdh26
    [16009.687815] fbtft_device: tontec35_9481
    [16009.687820] fbtft_device: tontec35_9486
    [16009.687825] fbtft_device: upd161704
    [16009.687830] fbtft_device: waveshare32b
    [16009.687835] fbtft_device: waveshare22
    [16009.687839] fbtft_device:

    root@nanopineo:/lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft# modprobe fbtft_device custom name=lm560g startbyte=0x00 speed=8000000 gpios=reset:201,dc:200

    root@nanopineo:/lib/modules/4.19.84-sunxi/kernel/drivers/staging/fbtft# dmesg |grep fbtft
    [16164.294787] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
    [16164.296943] fbtft_device: spi_busnum_to_master(0) returned NULL
    [16164.296956] fbtft_device: failed to register SPI device

  9. had build, and now boot from os, dmesg |grep fbtft, display :

    root@nanopineo:/etc/lirc# dmesg|grep fbtft
    [   10.705494] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
    [   10.712490] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
    [   10.714226] fbtft_device: spi_busnum_to_master(0) returned NULL
    [   10.714235] fbtft_device: failed to register SPI device

    my patch is build from: https://github.com/prius0304/fbtft---SSD1322/blob/master/fb_ssd1322.c

    any one can help me

     

  10. I had try build a new kernel with tft screen , module ssd1322, find source , and build patch file, just like attach file <spender-ssd1322.patch>, and put it to patch : build/userpatches/kernel/sunxi-next, . then do "compile.sh",  view patching.log, and compilation.log, compiler.log, no error! , directory build/cache/sources/linux-mainline/linux-4.19.y/drivers/staging/fbtft , no fb_ssd1322.o, .mod.c, .ko file output. build failed!

    help me , how to do

    spender-ssd1322.patch

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines