各位大佬好,本人在V851S平台调试驱动一块ST7789V的屏幕,发现SPI驱动无法挂载,跟踪调试发现fbtft-core.c中的fbtft_probe_common都没有得到调用,设备树和内核配置已打开,代码贴图如下
tips:另外还有一个线索就是之前有一块MIPI的屏幕,初始化代码也是正确的,同样无法点亮,大佬docker里面的代码可以点亮,由于内核代码量较大,实在无法比较查分,仅对比了Driver文件夹和设备树,发现是相同的
修改的设备树是这个目录下的,不清楚是否正确
...
&spi1 {
clock-frequency = <10000000>;
pinctrl-0 = <&spi1_pins_a &spi1_pins_b>;
pinctrl-1 = <&spi1_pins_c>;
pinctrl-names = "default", "sleep";
spi_slave_mode = <0>;
spi_dbi_enable = <1>;
spi1_cs_number = <1>;
status = "okay";
st7789v@0 {
status = "okay";
compatible = "sitronix,st7789v";
reg = <0>;
spi-max-frequency =<10000000>; //SPI时钟32M
rotate =<0>; //屏幕旋转90度
spi-cpol;
spi-cpha;
rgb; //颜色格式RGB
fps =<30>; //刷新30帧率
buswidth =<8>; //总线宽度8
reset-gpios=<&pio PD 5 1 0 1 0>; //GPIOE4
dc-gpios =<&pio PD 6 1 0 1 0>; //GPIOE5
debug =<1>; //不开启调试
};
};
...
...
static struct fbtft_display display = {
.regwidth = 8,
.width = 240,
.height = 280,
.gamma_num = 2,
.gamma_len = 14,
.gamma = DEFAULT_GAMMA,
.fbtftops = {
.init_display = init_display,
.set_var = set_var,
.set_gamma = set_gamma,
.blank = blank,
},
};
FBTFT_REGISTER_DRIVER(DRVNAME, "sitronix,st7789v", &display);
MODULE_ALIAS("spi:" DRVNAME);
MODULE_ALIAS("platform:" DRVNAME);
MODULE_ALIAS("spi:st7789v");
MODULE_ALIAS("platform:st7789v");
MODULE_DESCRIPTION("FB driver for the ST7789V LCD Controller");
MODULE_AUTHOR("Dennis Menschel");
MODULE_LICENSE("GPL");
最近编辑记录 mysteryli (2023-04-11 22:45:58)
离线