adafruit / Adafruit_Blinka_Displayio

Displayio for Blinka
MIT License
14 stars 20 forks source link

AML-S905X-CC (Le Potato) unable to run Simple Test Example but ILI9341 works as Monitor #126

Open Iainrach opened 1 year ago

Iainrach commented 1 year ago

Strangely I have managed to get the ILI9341 working as a monitor by some tweaking of overlays on the Le Potato but whatever I do I can't run the Simple Test Example without generating an error. I include some of the different combinations of overlay I tried and the overlays themselves.

Ili9341 SimpleTest Example configured for Le Potato

spi = Board.SPI() tft_cs = board.P24 tft_dc = board.P29

display_bus = displayio.FourWire( spi, command=tft_dc, chip_select=tft_cs, reset=board.P31 )


No Overlays Enabled # Doesn't work which is as expected - OSError: /dev/spidev0.0 does not exist

pi@PotatoPi2:~ $ ls /dev/spi ls: cannot access '/dev/spi': No such file or directory

%Run BlinkaILI9341.py Traceback (most recent call last): File "/home/pi/Iain/BlinkaILI9341.py", line 19, in spi = board.SPI() File "/usr/local/lib/python3.9/dist-packages/board.py", line 359, in SPI return busio.SPI(SCLK, MOSI, MISO) File "/usr/local/lib/python3.9/dist-packages/busio.py", line 301, in init self._spi = _SPI(portId) File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in init self._spi = spi.SPI(device=(portid, 0)) File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 167, in init raise IOError(f"{device} does not exist") OSError: /dev/spidev0.0 does not exist


spicc & spicc-spidev enabled # Doesn't like "cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>;" in spicc???? Errno 16

pi@PotatoPi2:~ $ ls /dev/spi* /dev/spidev0.0

%Run BlinkaILI9341.py Traceback (most recent call last): File "/home/pi/Iain/BlinkaILI9341.py", line 23, in display_bus = displayio.FourWire( File "/usr/local/lib/python3.9/dist-packages/displayio/_fourwire.py", line 64, in init self._chip_select = digitalio.DigitalInOut(chip_select) File "/usr/local/lib/python3.9/dist-packages/digitalio.py", line 165, in init self.direction = Direction.INPUT File "/usr/local/lib/python3.9/dist-packages/digitalio.py", line 195, in direction self._pin.init(mode=Pin.IN) File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 108, in init self._line.request( OSError: [Errno 16] Device or resource busy


Newspicc & spicc-spidev enabled # removed "cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>;" in Newspicc. Errno 22

pi@PotatoPi2:~ $ ls /dev/spi* /dev/spidev0.0

%Run BlinkaILI9341.py Traceback (most recent call last): File "/home/pi/Iain/BlinkaILI9341.py", line 26, in display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240) File "/usr/local/lib/python3.9/dist-packages/adafruit_ili9341.py", line 95, in init super().init(bus, _INIT_SEQUENCE, **kwargs) File "/usr/local/lib/python3.9/dist-packages/displayio/_display.py", line 157, in init self._initialize(init_sequence) File "/usr/local/lib/python3.9/dist-packages/displayio/_display.py", line 200, in _initialize self._core.send( File "/usr/local/lib/python3.9/dist-packages/displayio/_displaycore.py", line 275, in send self._send(data_type, chip_select, data) File "/usr/local/lib/python3.9/dist-packages/displayio/_fourwire.py", line 128, in _send self._spi.write(bytes([byte])) File "/usr/local/lib/python3.9/dist-packages/busio.py", line 386, in write return self._spi.write(buf, start, end) File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 86, in write self._spi.writebytes(buf[start:end]) File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 370, in writebytes ioctl(self.handle, SPI._IOC_MESSAGE, spi_ioc_transfer) OSError: [Errno 22] Invalid argument


spicc & spicc-spidev & Newspicc-ili9341 enabled # Newspicc-ili9341 fails to load properly according to Dmesg Errno 16

pi@PotatoPi2:~ $ ls /dev/spi* /dev/spidev0.0

[ 176.588760] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /aliases/spi0 [ 176.588797] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/status [ 176.588812] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-0 [ 176.588827] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-1 [ 176.588843] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-2 [ 176.588856] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-names [ 176.588869] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/cs-gpios [ 238.353266] meson-spicc c1108d80.spi: chipselect 0 already in use [ 238.353289] spi_master spi0: spi_device register error /soc/bus@c1100000/spi@8d80/display@0 [ 238.353311] of_spi_notify: failed to create for '/soc/bus@c1100000/spi@8d80/display@0' [ 238.353324] OF: changeset notifier error @/soc/bus@c1100000/spi@8d80/display@0 [ 238.353341] OF: overlay: overlay apply changeset entry notify error -16 [ 238.353347] create_overlay: Failed to create overlay (err=-16)

%Run BlinkaILI9341.py Traceback (most recent call last): File "/home/pi/Iain/BlinkaILI9341.py", line 23, in display_bus = displayio.FourWire( File "/usr/local/lib/python3.9/dist-packages/displayio/_fourwire.py", line 64, in init self._chip_select = digitalio.DigitalInOut(chip_select) File "/usr/local/lib/python3.9/dist-packages/digitalio.py", line 165, in init self.direction = Direction.INPUT File "/usr/local/lib/python3.9/dist-packages/digitalio.py", line 195, in direction self._pin.init(mode=Pin.IN) File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 108, in init self._line.request( OSError: [Errno 16] Device or resource busy


spicc & Newspicc-ili9341 enabled # ILI9341 screen comes alive as active monitor

pi@PotatoPi2:~ $ ls /dev/spi ls: cannot access '/dev/spi': No such file or directory

%Run BlinkaILI9341.py Traceback (most recent call last): File "/home/pi/Iain/BlinkaILI9341.py", line 19, in spi = board.SPI() File "/usr/local/lib/python3.9/dist-packages/board.py", line 359, in SPI return busio.SPI(SCLK, MOSI, MISO) File "/usr/local/lib/python3.9/dist-packages/busio.py", line 301, in init self._spi = _SPI(portId) File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in init self._spi = spi.SPI(device=(portid, 0)) File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 167, in init raise IOError(f"{device} does not exist") OSError: /dev/spidev0.0 does not exist

[ 21.717413] gx-sound-card sound: ASoC: PRE_PMU: be.dai-link-2-playback event failed: -22 [ 37.162586] rc rc0: two consecutive events of type space [ 48.041623] logitech-hidpp-device 0003:046D:4024.0004: HID++ 2.0 device connected. [ 56.287887] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /aliases/spi0 [ 56.287925] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/status [ 56.287940] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-0 [ 56.287956] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-1 [ 56.287970] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-2 [ 56.287983] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/pinctrl-names [ 56.287996] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c1100000/spi@8d80/cs-gpios [ 60.798137] panel-ilitek-ili9341 spi0.0: Looking up vcc-supply from device tree [ 60.798161] panel-ilitek-ili9341 spi0.0: Looking up vcc-supply property in node /soc/bus@c1100000/spi@8d80/display@0 failed [ 60.798192] panel-ilitek-ili9341 spi0.0: get optional vcc failed [ 60.799183] [drm] Initialized ili9341 1.0.0 20210716 for spi0.0 on minor 2 [ 60.803512] panel-ilitek-ili9341 spi0.0: [drm] fb1: ili9341drmfb frame buffer device [ 62.795935] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 64.489387] hdmi-audio-codec hdmi-audio-codec.2.auto: Not able to map channels to speakers (-22) [ 64.489413] hdmi-audio-codec hdmi-audio-codec.2.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22 [ 64.489423] gx-sound-card sound: ASoC: PRE_PMU: be.dai-link-2-playback event failed: -22 [ 80.677140] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 88.340797] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 90.666356] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 96.155494] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 103.357890] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 105.696759] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 110.675656] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface [ 115.677631] panel-ilitek-ili9341 spi0.0: [drm] Initialized display serial interface pi@PotatoPi2:~ $


spicc

/*

/*

/dts-v1/; /plugin/;

include <dt-bindings/gpio/gpio.h>

include <dt-bindings/gpio/meson-gxl-gpio.h>

/ { compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

fragment@0 {
    target-path = "/aliases";

    __overlay__ {
        spi0 = "/soc/cbus@c1100000/spi@8d80";
    };
};

fragment@1 {
    target = <&spicc>;

    __overlay__ {
        status = "okay";
        pinctrl-0 = <&spi_pins>;
        pinctrl-1 = <&spi_pins>, <&spi_idle_high_pins>;
        pinctrl-2 = <&spi_pins>, <&spi_idle_low_pins>;
        pinctrl-names = "default", "idle-high", "idle-low";

        cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>;
    };
};

};


Newspicc

/*

/dts-v1/; /plugin/;

include "gpio.h"

include "meson-gxl-gpio.h"

/ { compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

fragment@0 {
    target-path = "/aliases";

    __overlay__ {
        spi0 = "/soc/cbus@c1100000/spi@8d80";
    };
};

fragment@1 {
    target = <&spicc>;

    __overlay__ {
        status = "okay";
        pinctrl-0 = <&spi_pins>;
        pinctrl-1 = <&spi_pins>, <&spi_idle_high_pins>;
        pinctrl-2 = <&spi_pins>, <&spi_idle_low_pins>;
        pinctrl-names = "default", "idle-high", "idle-low";

    };
};

};


spicc-spidev

/*

/*

/dts-v1/; /plugin/;

/ { compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

fragment@0 {
    target = <&spicc>;

    __overlay__ {
        spidev@0 {
            compatible = "rohm,dh2228fv";
            reg = <0>;
            spi-max-frequency = <30000000>;
        };
    };
};

};


/*

/*

/dts-v1/; /plugin/;

include "gpio.h"

include "meson-gxl-gpio.h"

/ { compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

fragment@0 {
    target = <&spicc>;

    __overlay__ {
        /*
         * The display signals are connected to :
         * - SDO(MISO) to Pin21 (SPI_MISO)
         * - LED/Backlight to Pin2 (5v)
         * - SCK to Pin23 (SPI_CLK)
         * - SDI(MOSI) to Pin19 (SPI_MOSI)
         * - D/C to Pin29 (GPIOX_17)
         * - RESET to Pin31 (GPIOX_18)
         * - (LCD) CS to Pin24 (GPIOX_10)
         * - GND to Pin25 (GND)
         * - VCC/VIN to Pin17 (3.3V)
         */
        display@0 {
            compatible = "adafruit,yx240qv29", "ilitek,ili9341";
            reg = <0>;
            buswidth = <8>;
            spi-max-frequency = <30000000>;
            dc-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
            reset-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
            rotation = <270>;
            status = "okay";
        };
    };
};

};