WhyCan Forum(哇酷开发者社区)

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn

您尚未登录。

#1 2019-08-06 14:41:49

danile
会员
注册时间: 2019-07-08
累计积分: 72

请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

请教ST7789V,不显示,发现波形完全不对!仔细防照
http://zero.lichee.pro/%E8%B4%A1%E7%8C%AE/article%203.html?highlight=fbtft
LicheePizero_SPI_LCD_st7789.pdf

操作,还是没有效果!!!

dts文件: https://whycan.cn/files/members/1808/dts.zip


sun8i-v3s-licheepi-zero-dock.dts 文件:

/*
 * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

#include "sun8i-v3s-licheepi-zero.dts"

#include <dt-bindings/input/input.h>

/ {
	model = "Lichee Pi Zero with Dock";
	compatible = "licheepi,licheepi-zero-dock", "licheepi,licheepi-zero",
		     "allwinner,sun8i-v3s";

	aliases {
		ethernet0 = &emac;
	};

	leds {
		/* The LEDs use PG0~2 pins, which conflict with MMC1 */
		status = "disbaled";
	};

	chosen {
		/delete-node/ framebuffer@0;
	};
};


&spi0 {
	status = "okay";

	st7789v@0 {
		compatible = "sitronix,st7789v";
		reg = <0>;
		reset-gpios = <&pio 4 20 GPIO_ACTIVE_LOW>;
		dc-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>;
		/*backlight = <&pwm_bl>;*/
		spi-max-frequency = <15000000>;
		spi-cpol;
		spi-cpha;
		bgr;
		buswidth = <8>;
		rotate = <270>;
		fps = <10>;
	};

};


&codec {
	allwinner,audio-routing =
		"Headphone", "HP",
		"Headphone", "HPCOM",
		"MIC1", "Mic",
		"Mic",  "HBIAS";
	status = "okay";
};

&emac {
	status = "okay";
};

&mmc1 {
	broken-cd;
	bus-width = <4>;
	vmmc-supply = <&reg_vcc3v3>;
	status = "okay";
};

&lradc {
	vref-supply = <&reg_vcc3v0>;
	status = "okay";

	button@200 {
		label = "Volume Up";
		linux,code = <KEY_VOLUMEUP>;
		channel = <0>;
		voltage = <200000>;
	};

	button@400 {
		label = "Volume Down";
		linux,code = <KEY_VOLUMEDOWN>;
		channel = <0>;
		voltage = <400000>;
	};

	button@600 {
		label = "Select";
		linux,code = <KEY_SELECT>;
		channel = <0>;
		voltage = <600000>;
	};

	button@800 {
		label = "Start";
		linux,code = <KEY_OK>;
		channel = <0>;
		voltage = <800000>;
	};
};

加载驱动时候的波形如下:

文件:saleae 1.1.18版本以上可以打开   https://whycan.cn/files/members/1808/none.zip

_20190806143100.png


加载驱动时候的波形如下:

文件:saleae 1.1.18版本以上可以打开   https://whycan.cn/files/members/1808/fb.zip

_20190806143918.png

离线

#2 2019-08-06 15:19:06

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

离线

#3 2019-08-06 15:35:19

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!


下面的那个,好像复位引脚没有变高,也没有复位电平

最近编辑记录 danile (2019-08-06 15:36:04)

离线

#4 2019-08-06 15:37:09

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

spi 的时序能对上吗?

离线

#5 2019-08-06 15:44:07

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

spi 的时序能对上吗?


除了设备驱动加载时候,SPI发送的全是0,感觉不正常,加载完,我cat xxx>/dev/fb0  ,SPI前面一段杂乱的波形,后面数据是对的

离线

#6 2019-08-06 16:07:37

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

https://whycan.cn/t_2740.html

spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/

频率降低到 6M, 开启 cpol, cpha:

spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;

这样试一试.


https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt

离线

#7 2019-08-06 16:16:01

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

https://whycan.cn/t_2740.html

spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/

频率降低到 6M, 开启 cpol, cpha:

spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;

这样试一试.


https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt


还是不行呢  https://whycan.cn/files/members/1808/none_20190806-1615.zip

离线

#8 2019-08-06 16:29:21

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

danile 说:
晕哥 说:

https://whycan.cn/t_2740.html

spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/

频率降低到 6M, 开启 cpol, cpha:

spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;

这样试一试.


https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/sitronix%2Cst7789v.txt


还是不行呢  https://whycan.cn/files/members/1808/none_20190806-1615.zip


好像有点正常了,晚上试试,感谢晕哥

离线

#9 2019-08-06 16:35:55

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

等你好消息 ^_^

离线

#10 2019-08-06 16:42:24

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

等你好消息 ^_^


https://github.com/Lichee-Pi/linux/blob/zero-4.13.y/drivers/staging/fbtft/fb_st7789v.c

源代码里面没看到 复位的操作呢,为什么 Documentation\devicetree\bindings\display\panel\sitronix,st7789v.txt  文件里面有复位引脚!!

而且我发现ili9341里面有复位的相关操作:
https://github.com/Lichee-Pi/linux/blob/zero-4.13.y/drivers/staging/fbtft/fb_ili9341.c

par->fbtftops.reset(par);

离线

#11 2019-08-06 16:49:14

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

可能是在别的文件实现了:

$ grep reset-gpios -r drivers/staging/
drivers/staging/fbtft/fbtft-core.c:     ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
drivers/staging/greybus/arche-apb-ctrl.c:       apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);

离线

#12 2019-08-06 17:19:40

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

可能是在别的文件实现了:

$ grep reset-gpios -r drivers/staging/
drivers/staging/fbtft/fbtft-core.c:     ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
drivers/staging/greybus/arche-apb-ctrl.c:       apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);


这个复位Io应该不是屏幕的复位,而是系统的复位

离线

#13 2019-08-06 17:42:33

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

可能是在别的文件实现了:

$ grep reset-gpios -r drivers/staging/
drivers/staging/fbtft/fbtft-core.c:     ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
drivers/staging/greybus/arche-apb-ctrl.c:       apb->resetn_gpio = of_get_named_gpio(np, "reset-gpios", 0);


可以了,我加了那句就可以了,感谢

离线

#14 2019-08-06 18:23:58

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

现在可以显示了吗?

离线

#15 2019-08-06 20:57:38

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

现在可以显示了吗?

可以的,其实就是那个复位问题,至于波形很乱,是因为spi时钟超过了逻辑分析仪的上限了

离线

#16 2019-08-06 21:35:19

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

danile 说:
晕哥 说:

现在可以显示了吗?

可以的,其实就是那个复位问题,至于波形很乱,是因为spi时钟超过了逻辑分析仪的上限了

那代码是怎么改的呢?方便传个液晶显示的图片吗?

离线

#17 2019-08-06 22:07:48

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

把复位代码加载初始化之前:

_20190806220508.png



_20190806220655.jpg

离线

#18 2019-08-06 22:50:33

微凉VeiLiang
会员
注册时间: 2018-10-28
累计积分: 385
个人网站

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

屏幕看起来不错,还带触摸

离线

#19 2019-08-06 23:02:14

晕哥
管理员
注册时间: 2017-09-06
累计积分: 9,190

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

屏幕看起来效果挺好,在哪里买的?

离线

#20 2019-08-07 08:22:03

danile
会员
注册时间: 2019-07-08
累计积分: 72

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

晕哥 说:

屏幕看起来效果挺好,在哪里买的?



是以前给客户开发产品,给的几片,厂家好像叫做华宇彩晶

离线

#21 2019-11-25 18:55:19

liopen88
会员
注册时间: 2019-11-19
累计积分: 2

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

群主,你这边可以提供一下驱动代码吗?

离线

#22 2020-04-27 11:19:36

拉轰的脚踏车
会员
注册时间: 2020-03-20
累计积分: 122

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

正在用 A33 点 ST7789, 关注一下,感谢楼主分享。

离线

#23 2020-04-27 11:57:45

歌以咏志
会员
注册时间: 2019-09-21
累计积分: 180

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

果然有两个一样名字的驱动:

$ grep "sitronix,st7789v" -r drivers/
drivers/gpu/drm/panel/panel-sitronix-st7789v.c: { .compatible = "sitronix,st7789v" },
drivers/staging/fbtft/fb_st7789v.c:FBTFT_REGISTER_DRIVER(DRVNAME, "sitronix,st7789v", &display);

离线

#24 2020-04-27 16:09:48

拉轰的脚踏车
会员
注册时间: 2020-03-20
累计积分: 122

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

&pio {
        spi0_cs_pins: spi0_cs_pins {
                pins = "PC3", "PH6";
                function = "gpio_out";
        };
};

&spi0 {
        status ="okay";

        pinctrl-names = "default";
        pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
        cs-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>, <&pio 7 6 GPIO_ACTIVE_HIGH>;
        mx25l25635e:mx25l25635e@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-max-frequency = <50000000>;
                #address-cells = <1>;
                #size-cells = <1>;
        };

    panel@0 {
            compatible = "sitronix,st7789v";
            reg = <1>;
            reset-gpios = <&pio 2 4 GPIO_ACTIVE_LOW>;//PC4
            dc-gpios = <&pio 2 7 GPIO_ACTIVE_LOW>;//PC7
            /*backlight = <&pwm_bl>;*/
            spi-max-frequency = <6000000>;
            spi-cpol;
            spi-cpha;
            buswidth = <8>;
            rotate = <270>;
            bgr;
            fps = <10>;
            debug = <1>;
    };
};

log:

[    1.435253] fbtft_of_value: buswidth = 8
[    1.439213] fbtft_of_value: debug = 1
[    1.442881] fbtft_of_value: rotate = 270
[    1.446828] fbtft_of_value: fps = 10
[    1.451240] fb_st7789v spi0.1: fbtft_request_one_gpio: 'reset-gpios' = GPIO68
[    1.458478] fb_st7789v spi0.1: fbtft_request_one_gpio: 'dc-gpios' = GPIO71
[    1.803443] graphics fb1: fb_st7789v frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=10, spi0.1 at 6 MHz

但是 cat /dev/urandom > /dev/fb1 屏幕没有反应。

离线

#25 2020-04-28 07:31:03

rick lou
会员
注册时间: 2019-09-12
累计积分: 96

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

离线

#26 2020-11-13 01:59:44

avb
会员
注册时间: 2020-02-22
累计积分: 2

Re: 请教ST7789V,不显示,发现波形完全不对!请高手指点一二!!

This driver uses 9 bit spi mode.
v3s hardware spi controller supports only wordlen with multiples of 8 bits length.
Use spi-gpio bus driver instead.

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB