疫情,等了好久板子终于到了。


我这里使用的是坑网大佬提供的tiny200开发包,用的芒果派R3配置文件
1,配置其的介质,我板子上用的是nor-spi-flash,所以需要在设备树里面屏蔽掉nand-flash相关的节点,否则启动会有错误。
2,配置屏幕,这里我被困扰好久,其实只需要在uboot里面配置好屏幕参数即可,其他的无需修改,我想歪了,去修改panel,改了好久好多参数都灭有效果,钻牛角尖了,最后看到坑网小伙伴评论:F1C100s如何初始化LCD引脚 ?24bit如何修改成18bit。RGB666如何修改成565.。。。。 / 全志 SOC / WhyCan Forum(哇酷开发者社区)
linux如果用drm驱动,那么就和uboot无关。
linux如果用simplefb驱动,那么就是用uboot初始化的
我才恍然大悟,直接去uboot里面修改屏幕参数就行了

这个时候,我又有疑问了,这些le,ri,up,参数是个什么玩意,百度后找到了如下资料:
U-boot中通过ENV设置显示设备(如LCD)参数的方法与格式_韩半仙的博客-CSDN博客
- /******************************************************************
- * 解析结构体
- ******************************************************************/
- struct ctfb_res_modes {
- int xres; /* 可见分辨率 */
- int yres;
- /* 时序: 所有值都以像素时钟为单位(当然除了像素时钟本身) */
- int pixclock; /* 像素时钟(单位:微秒) */
- int left_margin; /* 从行同步到图像左边沿的像素时钟数 */
- int right_margin; /* 从行同步到图像右边沿的像素时钟数 */
- int upper_margin; /* 从场同步到图像上边沿的行数 */
- int lower_margin; /* 从场同步到图像下边沿的行数 */
- int hsync_len; /* 行同步时间长度(像素时钟数) */
- int vsync_len; /* 场同步时间长度(行数) */
- int sync; /* see FB_SYNC_* */
- int vmode; /* see FB_VMODE_* */
- };
参数无效_lcd参数解释及刷新率计算,LCD时序_刘万祥ExcelPro的博客-CSDN博客


到这就知道参数怎么设置,以及参数的含义了。
最后看下测试效果:

3,通过控制台命令切换USB模式,参考下面帖子
主线Linux用shell命令切换 OTG(分享)tiny200/licheepi nano|zero均可以使用 / 全志 SOC / WhyCan Forum(哇酷开发者社区)
- &usb_otg {
- dr_mode = "otg"; /* 三个可选项: otg / host / peripheral */
- status = "okay";
- };
-
- ##切换到host模式:
- # echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
- # [ 117.758152] phy phy-1c13400.phy.0: Changing dr_mode to 1
- [ 118.414817] usb 1-1: new high-speed USB device number 3 using musb-hdrc
- [ 118.598193] usb-storage 1-1:1.0: USB Mass Storage device detected
- [ 118.611789] scsi host0: usb-storage 1-1:1.0
- [ 119.686198] scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS
- [ 119.703976] sd 0:0:0:0: [sda] 3842048 512-byte logical blocks: (1.97 GB/1.83 GiB)
- [ 119.725260] sd 0:0:0:0: Attached scsi generic sg0 type 0
- [ 119.739844] sd 0:0:0:0: [sda] Write Protect is off
- [ 119.771819] sd 0:0:0:0: [sda] No Caching mode page found
- [ 119.777288] sd 0:0:0:0: [sda] Assuming drive cache: write through
- [ 119.801571] sda: sda1 sda2 sda3
- [ 119.817224] sd 0:0:0:0: [sda] Attached SCSI removable disk
-
- #
- ##切换到device模式:
- # echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
- [ 123.880272] phy phy-1c13400.phy.0: Changing dr_mode to 2
- # [ 123.890905] usb 1-1: USB disconnect, device number 3
下一步就是调试摄像头了。