请教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 = <®_vcc3v3>;
status = "okay";
};
&lradc {
vref-supply = <®_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
加载驱动时候的波形如下:
文件:saleae 1.1.18版本以上可以打开 https://whycan.cn/files/members/1808/fb.zip
离线
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
https://github.com/torvalds/linux/blob/master/drivers/staging/fbtft/fb_st7789v.c
你用的是哪个驱动程序?
离线
下面的那个,好像复位引脚没有变高,也没有复位电平
最近编辑记录 danile (2019-08-06 15:36:04)
离线
spi 的时序能对上吗?
除了设备驱动加载时候,SPI发送的全是0,感觉不正常,加载完,我cat xxx>/dev/fb0 ,SPI前面一段杂乱的波形,后面数据是对的
离线
spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/
频率降低到 6M, 开启 cpol, cpha:
spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;
这样试一试.
离线
spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/频率降低到 6M, 开启 cpol, cpha:
spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;这样试一试.
还是不行呢 https://whycan.cn/files/members/1808/none_20190806-1615.zip
离线
晕哥 说:spi-max-frequency = <50000000>;
/*spi-cpol;*/
/*spi-cpha;*/频率降低到 6M, 开启 cpol, cpha:
spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;这样试一试.
还是不行呢 https://whycan.cn/files/members/1808/none_20190806-1615.zip
好像有点正常了,晚上试试,感谢晕哥
离线
等你好消息 ^_^
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);
离线
可能是在别的文件实现了:
$ 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);
离线
可能是在别的文件实现了:
$ 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应该不是屏幕的复位,而是系统的复位
离线
可能是在别的文件实现了:
$ 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);
可以了,我加了那句就可以了,感谢
离线
现在可以显示了吗?
可以的,其实就是那个复位问题,至于波形很乱,是因为spi时钟超过了逻辑分析仪的上限了
离线
把复位代码加载初始化之前:
离线
屏幕看起来不错,还带触摸
离线
屏幕看起来效果挺好,在哪里买的?
是以前给客户开发产品,给的几片,厂家好像叫做华宇彩晶
离线
群主,你这边可以提供一下驱动代码吗?
离线
正在用 A33 点 ST7789, 关注一下,感谢楼主分享。
离线
果然有两个一样名字的驱动:
$ 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);
离线
&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 屏幕没有反应。
离线
离线
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.
离线
晕哥请问下这两个驱动程序有什么区别 都是生成fb设备的吗
离线
@HongSang
前面是drm架构驱动,后面的是传统fb的驱动。
drm也是能共和fbfbt驱动一样在/dev/下生成fb设备的么
离线
4.13和4.9.88的内核用网上的修改fb_st7789v.c和tbtft-core.c文件再编译报错定义之类的错,可以换5.几的内核,我感觉4.13和4.9.88的内核不太支持,小白经验发言,错了,大佬踹一脚
离线