Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Iainrach opened this issue Mar 1, 2023 · 0 comments

Comments

@Iainrach
Copy link

Iainrach commented Mar 1, 2023

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

/*

  • Copyright (c) 2017 BayLibre, SAS.
  • Author: Neil Armstrong [email protected]
  • SPDX-License-Identifier: (GPL-2.0+ OR MIT)
    */

/*

  • Overlay aimed to enable SPICC on Header 7J1 :
  • Pins 19 (MOSI), 21 (MISO), 23 (CLK), 24 (SS0)
    */

/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

/*

  • Overlay aimed to enable SPICC on Header 7J1 :
  • Pins 19 (MOSI), 21 (MISO), 23 (CLK), 24 (SS0)
    */

/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

/*

  • Copyright (c) 2017 BayLibre, SAS.
  • Author: Neil Armstrong [email protected]
  • SPDX-License-Identifier: (GPL-2.0+ OR MIT)
    */

/*

  • Overlay aimed to enable a spidev interface on SPICC bus with CS0
    */

/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>;
		};
	};
};

};


/*

  • Copyright (c) 2018 BayLibre, SAS.
  • Author: Neil Armstrong [email protected]
  • SPDX-License-Identifier: (GPL-2.0+ OR MIT)
    */

/*

  • Overlay aimed to enable the Ilitek ILI9341 based panels such as the :
    • Adafruit 2.2" SPI display
    • Adafruit 2.8" Touch Shield V2 (SPI)
    • Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroSD Socket
    • Adafruit 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket
    • Adafruit 2.2" 18-bit color TFT LCD display with microSD card breakout
    • Adafruit TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers
  • Pins 19 (MOSI), 21 (MISO), 23 (CLK), 24 (CS), 29 (DC), 31 (Reset)
    */

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

};

@makermelissa makermelissa transferred this issue from adafruit/Adafruit_CircuitPython_ILI9341 Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant