TinyVision LCD 无法显示
-
韦东山的TinyVision LCD-fb0无显示
编译环境
-
系统:
Ubuntu 18.04
-
V853的官方SDK:
repo init -u https://sdk.aw-ol.com/git_repo/V853Tina_Open/manifest.git -b master -m tina-v853-open.xml
-
BSP:
https://github.com/YuzukiHD/TinyVision/releases/download/tina.0.0.2/tina-bsp-tinyvision.tar.gz
-
按官方提供教程修改设备树、fbtft-core.c、fb_st7735V.c,并开启内核对应项
LCD显示失败
- 驱动可以正常挂载
[ 2.471777] fbtft_of_value: buswidth = 8 [ 2.471783] fbtft_of_value: debug = 1 [ 2.471787] fbtft_of_value: rotate = 0 [ 2.471791] fbtft_of_value: fps = 30 [ 2.472055] fb_st7789v spi0.0: fbtft_request_one_gpio: 'reset' = GPIO69 [ 2.472085] fb_st7789v spi0.0: fbtft_request_one_gpio: 'dc' = GPIO68 [ 2.472118] >>> Initializing ST7789V! [ 2.795038] >>> ST7789V Initialization Step1 [ 2.891084] >>> ST7789V Initialization Step2 [ 2.901859] >>> ST7789V Initialization Step3 [ 2.905311] >>> ST7789V Initialization Step4 [ 2.997770] >>> ST7789V Initialization Step5 [ 3.364106] >>> ST7789V Initialization Done!
- 进系统后,
ls /dev | grep fb
显示有fb0
存在 - 使用
cat /dev/random > /dev/fb0
直接卡死无响应 - 交叉编译如下
Framebuffer
测试代码,运行
#include <stdio.h> #include <linux/fb.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/mman.h> typedef unsigned short color_t; /* 565的屏 */ #define BLUE 0x001F /* 蓝色 */ #define GREEN 0x07E0 /* 绿色 */ #define RED 0xF800 /* 红色 */ static struct fb_var_screeninfo __g_vinfo; /* 显示信息 */ static color_t *__gp_frame; /* 虚拟屏幕首地址 */ int framebuffer_init (void) { int fd = 0; fd = open("/dev/fb0", O_RDWR); if (fd == -1) { perror("fail to open /dev/fb0\n"); return -1; } ioctl(fd, FBIOGET_VSCREENINFO, &__g_vinfo); /* 获取显示信息 */ printf("bits_per_pixel = %d\n", __g_vinfo.bits_per_pixel); /* 一个像素点对应的位数,如果值为16则为565格式输出,如果值为32则为888格式输出 */ printf("xres_virtual = %d\n", __g_vinfo.xres_virtual); /* 虚拟x轴像素点数 */ printf("yres_virtual = %d\n", __g_vinfo.yres_virtual); /* 虚拟y轴像素点数 */ printf("xres = %d\n", __g_vinfo.xres); /* x轴像素点数 */ printf("yres = %d\n", __g_vinfo.yres); /* y轴像素点数 */ __gp_frame = mmap(NULL, /* 映射区的开始地址,为NULL表示由系统决定映射区的起始地址 */ __g_vinfo.xres_virtual * __g_vinfo.yres_virtual * __g_vinfo.bits_per_pixel / 8, /* 映射区大小 */ PROT_WRITE | PROT_READ, /* 内存保护标志(可读可写) */ MAP_SHARED, /* 映射对象类型(与其他进程共享) */ fd, /* 有效的文件描述符 */ 0); /* 被映射内容的偏移量 */ if (__gp_frame == NULL) { perror("fail to mmap\n"); return -1; } return 0; } /** * \brief 填充整屏 */ void full_screen (color_t color) { int i; color_t *p = __gp_frame; for (i = 0; i < __g_vinfo.xres_virtual * __g_vinfo.yres_virtual; i++) { *p++ = color; } } int main(int argc, const char *argv[]) { if (framebuffer_init()) { printf("framebuffer_init failed\n"); return 0; } while (1) { full_screen(RED); /* 填充红色 */ sleep(1); full_screen(GREEN); /* 填充绿色 */ sleep(1); full_screen(BLUE); /* 填充蓝色 */ sleep(1); } return 0; }
- 显示如下信息,屏幕无信息刷新
-
-
屏幕是什么情况,背光,花屏,白屏,初始化是否写入
-
@awwwwa 屏幕背光常亮; cat /dev/random > /dev/fb0 时屏幕无反应
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号