jonokoi Posted September 23, 2019 Posted September 23, 2019 I’m trying to use a 3.5 LCD (waveshare clone) with ILI9486 + XPT2046 with my orange pi zero. My display is like this. I installed both Debian_buster_next_4.19.59 and Ubuntu_bionic_next_4.19.57 and I followed many guides in here with no success. I edited armbianEnv.txt and added these: overlays=spi-spidev spi-add-cs1 param_spidev_spi_bus=1 param_spidev_spi_cs=1 After that I ran this sudo modprobe fbtft_device custom name=fb_ili9486 gpios=dc:18,reset:2 speed=16000000 busnum=1 rotate=90 and didn’t get any error. I figured that the reset & DC pins on orange pi zero are pin22(GPIO2) and pin18(GPIO18) but I’m not 100% sure about these. With dmesg I see these: [ 179.174013] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 179.181645] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned. [ 179.183696] spidev spi1.1: spidev spi1.1 1000kHz 8 bits mode=0x00 [ 179.184295] fbtft_device: GPIOS used by 'fb_ili9486': [ 179.184307] fbtft_device: 'dc' = GPIO18 [ 179.184314] fbtft_device: 'reset' = GPIO2 [ 179.184331] spidev spi1.1: spidev spi1.1 1000kHz 8 bits mode=0x00 [ 179.184347] spi spi1.0: fb_ili9486 spi1.0 16000kHz 8 bits mode=0x00 [ 179.202576] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned. [ 179.749873] Console: switching to colour frame buffer device 60x40 [ 179.751385] graphics fb0: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 4 KiB buffer memory, fps=20, spi1.0 at 16 MHz I tried con2fbmap 1 0 but the screen remains white What else could I try? How could I debug the issue? 0 Quote
NicoD Posted September 23, 2019 Posted September 23, 2019 3 minutes ago, jonokoi said: What else could I try? How could I debug the issue? I believe the correct tutorial is this one. It seems you've tried something from another unanswered thread. 0 Quote
jonokoi Posted September 23, 2019 Author Posted September 23, 2019 I followed this guide too with no luck. I only changed the dc gpio from 71 to 18. (71 doesn't exist on orange pi zero so the guide is for another board) 0 Quote
John Wilson Posted January 3, 2020 Posted January 3, 2020 I've been hacking at this for a few days on Armbian_19.11.3_Orangepizero_bionic_current_5.3.9. I tried without luck to get fbtft_device to work, but looks like it's been deprecated in the most recent versions of the kernel. Only solution I found was to make a .dts myself. Try these steps out: > vim myili9486.dts # See file contents below > armbian-add-overlay myili9486.dts # N.B. I had to modify this file to get it to work properly - comment out line 45... i.e. if [[ $BRANCH != next && $BRANCH != dev ]]; then echo >&2 "Overlays are supported only on mainline kernel based images" # exit -1 fi > reboot /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; spidev@0{ status = "disabled"; }; spidev@1{ status = "disabled"; }; }; }; fragment@1 { target = <&pio>; __overlay__ { ili9486_pins: ili9486_pins { allwinner,pins = "PA2", "PA18"; allwinner,function = "gpio_in"; }; }; }; fragment@2 { target = <&spi1>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; ili9486: ili9486@0{ compatible = "ilitek,ili9486"; reg = <0>; pinctrl-names = "default"; pinctrl-0 = <&ili9486_pins>; spi-max-frequency = <16000000>; txbuflen = <32768>; rotate = <90>; bgr = <0>; fps = <30>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 2 1>; dc-gpios = <&pio 0 18 0>; debug = <0>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x1000036 0x28 0x1000011 0x1000029>; }; }; }; }; Once I rebooted the screen came up okay with a login prompt, I've based the DTS on the waveshare dts here: https://github.com/swkim01/waveshare-dtoverlays/blob/master/waveshare35a.dts I haven't tried setting up the touch screen yet! 0 Quote
mehmeh küçük Posted June 16, 2020 Posted June 16, 2020 i have a orange pi lite. I don't know about dts. which parameters should I change? and How did you connect the lcd and orange pins. 0 Quote
karlp Posted August 4, 2020 Posted August 4, 2020 John Wilson's device tree overlay was super helpful. I've gotten the LCD working on an Orange Pi PC plus, on armbian focal (20.04 based, kernel 5.4.x) with the following overlay. (I dropped defaults, optional settings, and things that reset back to defaults) /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&spi0>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&spi0>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; ili9486: ili9486@0 { compatible = "ilitek,ili9486"; reg = <0>; spi-max-frequency = <16000000>; rotate = <90>; fps = <30>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 2 1>; /* PA2 */ dc-gpios = <&pio 2 7 0>; /* PC7 */ //debug = <0>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x1000036 0x28 0x1000011 0x1000029>; }; }; }; }; Basically, this switches to SPI0, and updates the gpio used for data/command switching. (LCD_RS on some of the schematics) I've not got touch working (yet?) Note, this can only give you an LCD once linux has booted far enough, there's nothing here about uboot 0 Quote
Adrian Shajkofci Posted August 18, 2020 Posted August 18, 2020 Hi ! I've got a BananaPI Zero P2 (M2) with a H2+, and I try as well to install one of those screens, without success. However I've seen these pins: So DC is physical pin 18 and RST is physical pin 22, which means (fromhttp://wiki.banana-pi.org/香蕉派_BPI-M2_ZERO) PA2 and PC4, not PC7. Why did you put PC7 ? Then, are these pins configured as IN or OUT ? in Wiring pi, they become always OUT. Thanks 0 Quote
dkaugust Posted September 10, 2020 Posted September 10, 2020 For Bananapi M2 Zero reset-gpios = <&pio 0 2 1>; //40pin, phy.22 PA2 dc-gpios = <&pio 2 4 0>; //40pin, phy.18 PC4 allwinner H3/H2 spi0 only have 1 spi cs. 0 Quote
f5nlg Posted September 20, 2020 Posted September 20, 2020 On 8/4/2020 at 5:31 PM, karlp said: John Wilson's device tree overlay was super helpful. I've gotten the LCD working on an Orange Pi PC plus, on armbian focal (20.04 based, kernel 5.4.x) with the following overlay. (I dropped defaults, optional settings, and things that reset back to defaults) /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&spi0>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&spi0>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; ili9486: ili9486@0 { compatible = "ilitek,ili9486"; reg = <0>; spi-max-frequency = <16000000>; rotate = <90>; fps = <30>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 2 1>; /* PA2 */ dc-gpios = <&pio 2 7 0>; /* PC7 */ //debug = <0>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x1000036 0x28 0x1000011 0x1000029>; }; }; }; }; Basically, this switches to SPI0, and updates the gpio used for data/command switching. (LCD_RS on some of the schematics) I've not got touch working (yet?) Note, this can only give you an LCD once linux has booted far enough, there's nothing here about uboot hello i'm sorry but it doesn't works for me with kernel 5.8 , if you have tried with this kernel i'm interesting ... thanks in advance Jean-Philippe Piers . 0 Quote
f5nlg Posted September 20, 2020 Posted September 20, 2020 hello i'm sorry but it doesn't works for me with kernel 5.8 , if you have tried with this kernel i'm interesting ... thanks in advance Jean-Philippe Piers . 0 Quote
Arci Posted February 8, 2021 Posted February 8, 2021 Threre is dts for OPI PC2. But I tried set differet freq, but it is still same freq... How to set higher freq? /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h5"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&pio>; __overlay__ { tft35a_pins: tft35a_pins { allwinner,pins = "PC7", "PA2"; allwinner,function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins= "PA1"; function = "irq"; }; }; }; fragment@2 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; tft35a: tft35a@0 { compatible = "ilitek,ili9486"; reg = <0>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&tft35a_pins>; spi-max-frequency = <16000000>; txbuflen = <32768>; rotate = <90>; bgr = <0>; fps = <25>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 2 0>; /* PA2 */ dc-gpios = <&pio 0 71 0>; /* PC7 */ debug = <1>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 /* piscreen -> waveshare35a */ 0x1000036 0x28 0x1000011 0x1000029>; }; tft35a_ts: tft35a-ts@1 { compatible = "ti,ads7846"; reg = <1>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; spi-max-frequency = <2000000>; interrupts = <0 1 2>; /* PA1 IRQ_TYPE_EDGE_FALLING */ interrupt-parent = <&pio>; pendown-gpio = <&pio 0 1 0>; /* PA1 */ ti,x-min = /bits/ 16 <0>; ti,y-min = /bits/ 16 <0>; ti,x-max = /bits/ 16 <0x0FFF>; ti,y-max = /bits/ 16 <0x0FFF>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <0xFFFF>; ti,x-plate-ohms = /bits/ 16 <400>; }; }; }; __overrides__ { speed = <&tft35a>,"spi-max-frquency:0"; txbuflen = <&tft35a>,"txbuflen:0"; rotate = <&tft35a>,"rotate:0"; fps = <&tft35a>,"fps:0"; bgr = <&tft35a>,"bgr:0"; debug = <&tft35a>,"debug:0"; swapxy = <&tft35a_ts>,"ti,swap-xy?"; }; }; 0 Quote
yam1 Posted February 8, 2021 Posted February 8, 2021 Somebody worked on kernel decided to limit the SPI speed to 10mhz, this is found in drivers/gpu/drm/drm_mipi_dbi.c, in routine u32 mipi_dbi_spi_cmd_max_speed(...), it is returning "return min_t(u32, 10000000, spi->max_speed_hz);" I dont know what was the intention, is min_t supposed to be max_t ? Anyway, if you change min_t to max_t, it would work, or if you change the constant to something bigger. I changed the constant to 128mhz (128000000) for my keidei, MHS devices. Here is the patch: drm.patch 0 Quote
Arci Posted March 3, 2021 Posted March 3, 2021 I tried successfully compile with this patch, but system ignore SPI speed. Display working, but it is very slowly drawing. How to set the frequency and how to check it? Armbian 21.05.0-trunk Focal with Linux 5.10.19-sunxi64 0 Quote
yam1 Posted March 7, 2021 Posted March 7, 2021 Note that the patch was for DRM drivers, not FBTFT drivers. You should see in dmesg it is using drmfb. Also ili9486 hardware is itself very slow, the DRM patch would not fix this. It would not make it draw faster than FBTFT drivers. Did you try changing SPI speed to 32mhz? The patch works well with the newer MHS displays that can run up to 128 mhz. For the newer 3.5 MHS displays, you do not need any patches. For the 4.0 MHS displays, you will need a init string patch. 0 Quote
Arci Posted March 9, 2021 Posted March 9, 2021 If I try to set something as spi-max-frequency, fps, rotate then I have still same visual output... It I mean still is display very slow. Debug flag is ignored too.. :-( On Raspberry Pi 3B+ working correctly and it accept higher SPI freq.... [ 5.852051] ads7846 spi1.1: supply vcc not found, using dummy regulator [ 5.869551] ads7846 spi1.1: touchscreen, irq 96 [ 5.888521] input: ADS7846 Touchscreen as /devices/platform/soc/1c69000.spi/spi_master/spi1/spi1.1/input/input1 [ 7.723726] ili9486 spi1.0: [drm] fb0: ili9486drmfb frame buffer device [ 7.754428] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 7.761687] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned. /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h5"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&pio>; __overlay__ { fbtft_pins: fbtft_pins { allwinner,pins = "PC7", "PA2"; allwinner,function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins= "PA1"; function = "irq"; }; }; }; fragment@2 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; fbtft: fbtft@0 { compatible = "ilitek,ili9486"; reg = <0>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&fbtft_pins>; spi-max-frequency = <32000000>; txbuflen = <32768>; rotate = <270>; bgr = <0>; fps = <50>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 2 0>; /* PA2 */ dc-gpios = <&pio 0 71 0>; /* PC7 */ debug = <4>; init = <0x10000b0 0x00 0x1000011 0x20000ff 0x100003a 0x55 0x1000036 0x28 0x10000c2 0x44 0x10000c5 0x00 0x00 0x00 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 /* piscreen -> waveshare35a */ 0x1000036 0x28 0x1000011 0x1000029>; }; fbtft_ts: fbtft-ts@1 { compatible = "ti,ads7846"; reg = <1>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; spi-max-frequency = <2000000>; interrupts = <0 1 2>; /* PA1 IRQ_TYPE_EDGE_FALLING */ interrupt-parent = <&pio>; pendown-gpio = <&pio 0 1 0>; /* PA1 */ ti,x-min = /bits/ 16 <0>; ti,y-min = /bits/ 16 <0>; ti,x-max = /bits/ 16 <0x0FFF>; ti,y-max = /bits/ 16 <0x0FFF>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <0xFFFF>; ti,x-plate-ohms = /bits/ 16 <400>; }; }; }; __overrides__ { speed = <&fbtft>,"spi-max-frequency:0"; txbuflen = <&fbtft>,"txbuflen:0"; rotate = <&fbtft>,"rotate:0"; fps = <&fbtft>,"fps:0"; bgr = <&fbtft>,"bgr:0"; debug = <&fbtft>,"debug:0"; swapxy = <&fbtft_ts>,"ti,swap-xy?"; }; }; 0 Quote
leoncoolmoon Posted November 29, 2022 Posted November 29, 2022 tested Armbian_20.05.4_Orangepizero_focal_current_5.4.45 works but it will back to white sceen is update+upgrade. any way to fix it? 0 Quote
SKQR01 Posted January 3 Posted January 3 (edited) Hello, can you help me create a similar file, but for the Orange Zero 3 board and the MHS3528 display with the ILI9486 chip? I'm new to this topic, so I'm asking for help. It would also be nice if you left comments in the text of the file to understand where it comes from (I think this can help many beginners). Or can I just take the finished file proposed in this topic and use it in Orangepi Zero 3? Edited January 3 by SKQR01 correction 0 Quote
ratandalez Posted January 10 Posted January 10 I tried successfully compile with this patch, but system ignore SPI speed. Display working, but it is very slowly drawing. How to set the frequency and how to check it? 0 Quote
Recommended Posts
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.