[rv1126求助]关于驱动SPI ST7789显示屏的问题
您好,自己设计的底板上有两个st7789的1.3寸屏 分别连接到spi0m1和spi1m2上,dts配置如下&spi0 {
status = "okay";
pinctrl-0 = <&spi0m1_clk &spi0m1_cs0n &spi0m1_cs1n &spi0m1_miso &spi0m1_mosi>;
pinctrl-1 = <>;
//pinctrl-1 = <&spi0m1_clk_hs &spi0m1_cs0n &spi0m1_cs1n &spi0m1_miso_hs &spi0m1_mosi_hs>;
/*spidevtest0: spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <48000000>;
status = "okay";
};*/
st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <48000000>;
buswidth = <8>;
rotate = <0>;
fps = <30>;
rgb;
dc-gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
//led-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>
debug = <0x00>;
};
};
&spi1 {
status = "okay";
pinctrl-0 = <&spi1m2_clk &spi1m2_cs0n &spi1m2_cs1n &spi1m2_miso &spi1m2_mosi>;
pinctrl-1 = <>;
/*spidevtest0: spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <48000000>;
status = "okay";
};*/
st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <48000000>;
buswidth = <8>;
rotate = <0>;
fps = <30>;
rgb;
dc-gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
//led-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>
debug = <0x00>;
};
};
现在spi1下的显示屏能够正常使用,/dev下fb0和fb1均存在且可正常写入。逻辑分析仪看了spi和dc reset口的时序基本是正常的,但spi0下的显示屏未能正常初始化(初始化的时序也基本正常,但存在细微抖动),因此无法显示。dmesg如下。
fbtft_of_value: buswidth = 8
fbtft_of_value: debug = 0
fbtft_of_value: rotate = 0
fbtft_of_value: fps = 30
of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/spi@ff450000/st7789v@0' - status (0)
of_get_named_gpiod_flags: parsed 'dc-gpios' property of node '/spi@ff450000/st7789v@0' - status (0)
mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
mmc_host mmc1: Bus speed (slot 0) = 100000Hz (slot req 100000Hz, actual 100000HZ div = 0)
Freeing initrd memory: 8948K
graphics fb0: fb_st7789v frame buffer, 135x240, 63 KiB video memory, 4 KiB buffer memory, fps=30, spi0.0 at 48 MHz
fbtft_of_value: buswidth = 8
fbtft_of_value: debug = 0
fbtft_of_value: rotate = 0
fbtft_of_value: fps = 30
of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/spi@ff5b0000/st7789v@0' - status (0)
of_get_named_gpiod_flags: parsed 'dc-gpios' property of node '/spi@ff5b0000/st7789v@0' - status (0)
graphics fb1: fb_st7789v frame buffer, 135x240, 63 KiB video memory, 4 KiB buffer memory, fps=30, spi1.0 at 48 MHz
请问spi0以及GPIO2-C1/C2在rv1126中是有什么特殊的需要注意的吗 还是说其他的原因类似dmesg中mmc_host那一段引发了异常呢,谢谢。
“GPIO2-C1/C2在rv1126中是有什么特殊的需要注意的吗” 使用的时候需要注意引脚复用问题,但是你都说了逻辑分析检查时序没有问题,那应该没有问题。检查信号线读写是否正常咯。 板蓝根 发表于 2021-8-31 09:22
“GPIO2-C1/C2在rv1126中是有什么特殊的需要注意的吗” 使用的时候需要注意引脚复用问题,但是你都说了逻辑 ...
现在一共mosi cs clk dc res五根线 逻辑分析仪看起来都没有问题 请问信号读写怎么检查呢 本帖最后由 板蓝根 于 2021-8-31 14:25 编辑
没有调过 spi 的屏幕,但是 spi 设备应该会通过 spi 读写寄存器的吧,跟踪一下驱动读写寄存器看看正不正常。再就是不清楚你的屏幕又没有 color bur 彩条调试模式,一般的屏幕可以通过设置寄存器让屏幕自己输出彩条来调试。 你好,博主,请问一下你的cs是如何进行控制的?可以分享一份你的驱动dome吗?
页:
[1]