全志 H6 Orange Pi Lite 2 Android 7.0 OTG配置

本文详细介绍了在全志H6的Orange Pi Lite 2上配置Android 7.0 OTG功能的过程,包括查看原理图确认管脚、修改sys_config.fex配置文件、重新编译Kernel并打包镜像,以及最后的测试步骤,通过OTG功能实现USB ADB调试。
摘要由CSDN通过智能技术生成

问题原因

因为之前没有电源线,一直使用OTG口进行供电,找到了条PSP的电源线,发现可以使用,也算是闲置物品再利用吧。测试时发现OTG功能用不了,接下来继续解决。
这里写图片描述

查看原理图,确认管脚

查看原理图可以确认,OTG部分使用的是USB0模块,并且有IDDET,检测端口,这个端口是用来区分OTG所扮演的角色,是HOST还是Device。电平触发。IDDET管脚连接到芯片的PC6口。
这里写图片描述
这里写图片描述

sys_config.fex配置

找到OTG配置项

;--------------------------------
;[usbc0]: usbc0 configuration.
;usb_used: usb controller enable. 0-disable, 1-enable.
;usb_port_type: usb mode. 0-device, 1-host, 2-otg.
;usb_detect_type: usb hotplug detect mode. 0-none, 1-vbus/id detect, 2-id/dpdm detect.
;usb_detect_mode: usb otg switch has two config. 0-thread scan, 1-id gpio interrupt.
;usb_id_gpio: usb id detect IO.
;usb_det_vbus_gpio: USB DET_VBUS has two config. (1)gpio pin; (2)"axp_ctrl", use axp intf.
;usb_drv_vbus_gpio: USB DRY_VBUS has two config. (1)gpio pin; (2)"axp_ctrl", use axp intf.
;--------------------------------
;--------------------------------
;--- USB0 CONFIG
;--------------------------------
[usbc0]
usbc0_used = 1
usb_port_type = 1
usb_detect_type = 1
usb_detect_mode = 0
usb_id_gpio =
usb_det_vbus_gpio =
usb_drv_vbus_gpio = port:PL05<1><0><default><1>
usb_host_init_state = 1
usb_regulator_io = "nocare"
usb_wakeup_suspend = 0
;--- USB Device
usb_luns = 3
usb_serial_unique = 0
usb_serial_number = "20080411"
rndis_wceis = 1

下面解析下每项含义
usbc0_used = 是否使能
usb_port_type = USB端口类型,0-device only,1-host only,2-otg
usb_detect_type = usb hotplug detect mode. 0-none, 1-vbus/id detect, 2-id/dpdm detect.
usb_detect_mode = usb otg switch has two config. 0-thread scan, 1-id gpio interrupt.
usb_id_gpio = usb id pin配置
usb_det_vbus_gpio = usb det vbus pin配置
usb_drv_vbus_gpio = usb drv vbus pin配置
usb_host_init_state = host only模式下,host端口初始化状态,0-初始化后usb不工作,1-初始化后usb工作
usb_regulator_io = usb供电的regulator gpio
usb_wakeup_suspend = 是否支持usb唤醒功能
usb_luns = 使用mass storage功能时盘符数量
usb_serial_unique = usb device的序列号是否唯一:1唯一,使用chip id;0相同,使用usb_serial_number制定
usb_serial_number = usb device的序列号
rndis_wceis = wireless rndis使能标志,1使能;0禁止。

从代码中看到,USB0默认被配置成为host模式,目前没有OTG接头,无法测试Host模式,接下来我们需要按照原理图配置成OTG模式

lemon@ubuntu:~/Develop/OrangePi_Lite2/lichee$ git diff tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
diff --git a/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex b/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
index 0e43e22..dc74d30 100755
--- a/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
+++ b/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
@@ 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

甜牛奶蛋糕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值