dts配置:
&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
最近编辑记录 raspberryman (2021-02-19 17:39:26)
离线
占坑
离线
占坑
离线
多谢分享 标记一下
离线
正需要这东西,太感谢了
离线
刚打算要飞usbid线 测试otg,看到这个又省了一个io了。。。
经测试,正常;
感谢raspberryman!
离线
刚打算要飞usbid线 测试otg,看到这个又省了一个io了。。。
经测试,正常;
感谢raspberryman!
奇怪 我的荔枝派zero V3s linux4.13 不行呢,不知道啥原因。
离线
MTLINUX 说:刚打算要飞usbid线 测试otg,看到这个又省了一个io了。。。
经测试,正常;
感谢raspberryman!奇怪 我的荔枝派zero V3s linux4.13 不行呢,不知道啥原因。
你要贴上错误信息才能去看原因。
离线
我试了试发现也不行,执行 echo host > ..., echo otg > ..., echo peripheral > ... 等指令都没有任何反应,内核也不打印任何信息。
我用的是aodzip的buildroot包,
https://github.com/aodzip/buildroot-tiny200
这是咋回事呢?dmesg 输出看起来usb设备初始化正常啊,没任何error之类的信息。
...
[ 0.142456] usbcore: registered new interface driver usbfs
[ 0.142576] usbcore: registered new interface driver hub
[ 0.142724] usbcore: registered new device driver usb
...
[ 0.930624] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.937159] ehci-platform: EHCI generic platform driver
[ 0.942911] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.949220] ohci-platform: OHCI generic platform driver
[ 0.954922] usbcore: registered new interface driver usb-storage
[ 0.962008] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 0.973873] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 0.979843] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 0.988308] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 0.996574] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.003872] usb usb1: Product: MUSB HDRC host driver
[ 1.008889] usb usb1: Manufacturer: Linux 5.4.92 musb-hcd
[ 1.014286] usb usb1: SerialNumber: musb-hdrc.1.auto
[ 1.020898] hub 1-0:1.0: USB hub found
[ 1.024802] hub 1-0:1.0: 1 port detected
...
最近编辑记录 unturned3 (2021-03-08 21:01:39)
离线
啊,发现了为啥了。我不小心把 /etc/init.d/S98uMTPrd 这个脚本给禁用了,怪不得呢……
重新启用了就没问题了
离线
芒果派 R3 可用。
用的是buildroot https://github.com/mangopi-sbc/buildroot-mangopi-r
离线
v3s 需要改下目录
echo host > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
echo peripheral > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
离线
牛贴,明天试一下v3s,ADB没跑起来,再次确认是不是usb
otgID问题
离线
按照说明操作,我的pc现在可以识别到cdc的一个设备,但是作为host 插入U盘 读卡器之类的还是没有反应,哪位老板给指点一下
离线
请教我想接USB键盘,linux内核至少需要打开哪些设置?
离线
@raspberryman
你好,请问,为何在nano neo pi 下,只有这些信息,谢谢了。
1c02000.dma-controller/ 1c1d400.usb/ 1c2b400.i2c/
1c0c000.lcd-controller/ 1c20800.pinctrl/ 1c30000.ethernet/
1c0f000.mmc/ 1c20c00.timer/ 1c40000.gpu/
1c14000.eeprom/ 1c20ca0.watchdog/ 1c68000.spi/
1c19000.usb/ 1c22800.i2s/ 1ee0000.hdmi/
1c19400.phy/ 1c22c00.codec/ 1f00000.rtc/
1c1a000.usb/ 1c25000.ths/ 1f015c0.codec-analog/
1c1a400.usb/ 1c28000.serial/ 1f02c00.pinctrl/
1c1b000.usb/ 1c28400.serial/
1c1b400.usb/ 1c28800.serial/
离线