Skip to content

Commit dff7737

Browse files
authored
更新 README.md
1 parent 5cec85a commit dff7737

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

docs/README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ OpenCV --->
14031403

14041404
![image-20240122202827423](assets/post/README/image-20240122202827423.png)
14051405

1406-
然后编译固件即可,请注意 Python3 编译非常慢,需要耐心等待下。
1406+
然后编译固件即可,请注意 Python3 编译非常慢,而且需要编译机有16G以上内存,需要耐心等待下。
14071407

14081408
编写一个 Python 脚本,执行上面的相同操作
14091409

@@ -5012,6 +5012,50 @@ FINSH_FUNCTION_EXPORT_ALIAS(hello_cmd, hello, Show Hello World)
50125012

50135013
![image-20230215142007978](assets/post/README/image-20230215142007978.png)
50145014

5015+
# USB OTG 切换模式
5016+
## Linux 4.9 内核
5017+
切换到 Device 模式
5018+
```
5019+
cat /sys/devices/platform/soc/usbc0/usb_device
5020+
```
5021+
切换到 Host 模式
5022+
```
5023+
cat /sys/devices/platform/soc/usbc0/usb_host
5024+
```
5025+
5026+
## Linux 5.15 以上内核
5027+
5028+
切换到 Device 模式
5029+
```
5030+
cat /sys/devices/platform/soc@3000000/soc@3000000:usbc0@0/usb_device
5031+
```
5032+
切换到 Host 模式
5033+
```
5034+
cat /sys/devices/platform/soc@3000000/soc@3000000:usbc0@0/usb_host
5035+
```
5036+
5037+
## 设备树配置
5038+
5039+
```
5040+
&usbc0 {
5041+
device_type = "usbc0";
5042+
usb_port_type = <0x0>;
5043+
usb_detect_type = <0x0>;
5044+
usb_detect_mode = <0x0>;
5045+
usb_id_gpio;
5046+
usb_det_vbus_gpio;
5047+
/* det_vbus_supply = <&usb_power_supply>; */
5048+
usb_regulator_io = "nocare";
5049+
usb_wakeup_suspend = <0>;
5050+
usb_serial_unique = <0>;
5051+
usb_serial_number = "20080411";
5052+
status = "okay";
5053+
};
5054+
```
5055+
5056+
- `usb_port_type` 配置为0是Device模式,1是Host模式 2是OTG模式。
5057+
- `usb_id_gpio` 配置对应的USB ID引脚(TinyVision 无ID引脚)。
5058+
- `usb_det_vbus_gpio`,(TinyVision 无检测引脚) 需要根据实际情况进行配置:
50155059

50165060

50175061
# 内核驱动支持情况

0 commit comments

Comments
 (0)