您尚未登录。

#8 Re: 全志 SOC » v3s 连接st7789屏显示闪屏,显示更新不正常 » 2020-08-11 18:26:38

static void lcd_panel_st7789s_init(void)
{
	u32 x = 240, y = 320, sel = 0;

	sunxi_lcd_cpu_write_index(0x11);
	//sunxi_lcd_delay_ms(120); //Delay 120ms
	rt_thread_delay(120);
	//-------------Display and color format setting---------------
	sunxi_lcd_cpu_write_index(0x36);
	sunxi_lcd_cpu_write_data(0x00);   // 0x60  320*240    0x80 240*320    // 0x08  rgb 

/*
	sunxi_lcd_cpu_write_index(0x2A);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x01);
	sunxi_lcd_cpu_write_data(0x3f);

	sunxi_lcd_cpu_write_index(0x2B);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0xef);
*/
	sunxi_lcd_cpu_write_index(0x3a);	//262k,?????0X66, 65K,?????0X55
	sunxi_lcd_cpu_write_data(0x55);
	//----------ST7789S Frame rate setting----------

	sunxi_lcd_cpu_write_index(0xb2);
	sunxi_lcd_cpu_write_data(0x0c);  // 8
	sunxi_lcd_cpu_write_data(0x0c);  // 8
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x33);  // 22
	sunxi_lcd_cpu_write_data(0x33);  // 22

	sunxi_lcd_cpu_write_index(0xb3);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x0f);
	sunxi_lcd_cpu_write_data(0x0f);


	sunxi_lcd_cpu_write_index(0xb7);
	sunxi_lcd_cpu_write_data(0x35 );
	//----------ST7789S Power setting-----------------

	sunxi_lcd_cpu_write_index(0xbb);
	sunxi_lcd_cpu_write_data(0x28 );   // 27

	//sunxi_lcd_cpu_write_index(0,0xc0);
	//sunxi_lcd_cpu_write_data(0,0x6e ); //0x2c

	sunxi_lcd_cpu_write_index(0xc2);
	sunxi_lcd_cpu_write_data(0x01 );

	sunxi_lcd_cpu_write_index(0xc3);
	sunxi_lcd_cpu_write_data(0x10 );  //0b

	sunxi_lcd_cpu_write_index(0xc4);
	sunxi_lcd_cpu_write_data(0x20 );

	sunxi_lcd_cpu_write_index(0xc6);        
	sunxi_lcd_cpu_write_data(0x0f );  //0xf

	sunxi_lcd_cpu_write_index(0xd0);
	sunxi_lcd_cpu_write_data(0xa4 );
	sunxi_lcd_cpu_write_data(0xa1 );

	//-----------ST7789S gamma setting----------------
	sunxi_lcd_cpu_write_index(0xe0);
	sunxi_lcd_cpu_write_data(0xd0);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x02);
	sunxi_lcd_cpu_write_data(0x07);
	sunxi_lcd_cpu_write_data(0x0b);       //
	sunxi_lcd_cpu_write_data(0x1a);       // 19
	sunxi_lcd_cpu_write_data(0x31);       //2e
	sunxi_lcd_cpu_write_data(0x54);      //54
	sunxi_lcd_cpu_write_data(0x40);      //41
	sunxi_lcd_cpu_write_data(0x29);      //2d
	sunxi_lcd_cpu_write_data(0x12);       //17
	sunxi_lcd_cpu_write_data(0x12);     //18
	sunxi_lcd_cpu_write_data(0x12);      //12
	sunxi_lcd_cpu_write_data(0x17);      //17

	sunxi_lcd_cpu_write_index(0xe1);
	sunxi_lcd_cpu_write_data(0xd0);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x02);
	sunxi_lcd_cpu_write_data(0x07);
	sunxi_lcd_cpu_write_data(0x05);       // 04
	sunxi_lcd_cpu_write_data(0x25);       //24
	sunxi_lcd_cpu_write_data(0x2d);       //2c
	sunxi_lcd_cpu_write_data(0x44);       
	sunxi_lcd_cpu_write_data(0x45);        //42
	sunxi_lcd_cpu_write_data(0x1c);       //
	sunxi_lcd_cpu_write_data(0x18);          // 1a
	sunxi_lcd_cpu_write_data(0x16);     //17
	sunxi_lcd_cpu_write_data(0x1c);       //15
	sunxi_lcd_cpu_write_data(0x1d);       //18

	sunxi_lcd_cpu_write_index(0x29);
	//sunxi_lcd_delay_ms(20);
	rt_thread_delay(20);

	// addr x
	sunxi_lcd_cpu_write_index(0x2a);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data((x-1)>>8);
	sunxi_lcd_cpu_write_data((x-1)&0xff);

	//addr y

	sunxi_lcd_cpu_write_index(0x2b);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data(0x00);
	sunxi_lcd_cpu_write_data((y-1)>>8);
	sunxi_lcd_cpu_write_data((y-1)&0xff);

	sunxi_lcd_cpu_write_index(0x2C);
	//lcd_cpu_panel_fr(sel, x, y, 0, 0);
}

配置代码在bsp内复制出来的。
在rethread下运行显示。

#9 全志 SOC » v3s 连接st7789屏显示闪屏,显示更新不正常 » 2020-08-11 18:23:39

yytyu
回复: 4

FluxBB bbcode 测试

FluxBB bbcode 测试

视频
整屏幕更新颜色是,看到屏幕的颜色闪动,如上图的变化。是st7789配置问题,还是驱动的问题?

#28 全志 SOC » v3s u-boot-2019.10 usb host 能识别u盘 » 2020-02-04 17:56:01

yytyu
回复: 16

在u-boot-2019.10 调试 usb host 功能,能读浏览u盘目录

U-Boot 2019.10 (Feb 04 2020 - 17:43:43 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   mmc@01c0f000: 0
Loading Environment from FAT... Card did not respond to voltage select!
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   No ethernet found.
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0 
=> usb reset
resetting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 2 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
=> usb info
1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller 
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Mass Storage,  USB Revision 2.10
 - Prolific Technology Inc. USB SD Card Reader      ABCDEF0123456789AB
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x067b  Product 0x2731 Version 1.0
   Configuration: 1
   - Interfaces: 1 Bus Powered 500mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 Out Bulk MaxPacket 512
     - Endpoint 2 In Bulk MaxPacket 512

1: Hub,  USB Revision 1.10
 -  U-Boot Root Hub 
 - Class: Hub
 - PacketSize: 8  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 0.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms

=> fatls usb 0
            System Volume Information/
       11   1.txt
            123/

1 file(s), 2 dir(s)

=> 

#31 Re: 全志 SOC » v3s 在从flash上起动rtthread有问题 » 2019-10-27 19:07:26

用xboot的方式和uboot的方式启动都是一样起动不了

#32 全志 SOC » v3s 在从flash上起动rtthread有问题 » 2019-10-27 11:40:14

yytyu
回复: 3

问题:v3s 跑rtthread 系统,加上公司的库,下载到ram下启动,正常启动。把程序下到spi flash内,从flash 启动,就不能启动了。屏蔽了库功能,从flash启动也能启动起。请问这问题怎样解决。ram 下和flash下启动V3s 系统配置有不同的了。

页脚

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

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