大家好,
目前使用BSP为yocto L4.1.15-2.1.0,芯片为imx6solo。
目前在使用OTG功能验证时,OTG做device连接PC是没有问题的,但是做host连接U盘时,串口不断的重复打印以下信息,从log来看,是识别了又断开了,不知道是什么问题,请大家帮忙,谢谢。
1.OTG什么都不接的时候,测量ID pin默认被硬件拉高。
2.OTG连接U盘,测量到ID pin上的电阻,一边为低电平,另一边为高电平。
3.OTG设备树配置如下:
reg_usb_otg_vbus: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "usb_otg_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio4 15 0>;
enable-active-high;
};
&usbotg {
vbus-supply = <®_usb_otg_vbus>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usbotg>;
disable-over-current;
dr_mode = "otg";
status = "okay";
};
pinctrl_usbotg: usbotggrp {
fsl,pins = <
MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x000b0
MX6QDL_PAD_KEY_COL4__USB_OTG_OC 0x1b0b0
>;
};
4.串口打印的log如下:
[ 16.472251] ci_hdrc ci_hdrc.0: EHCI Host Controller
[ 16.477287] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2
[ 16.503505] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 16.519682] hub 2-0:1.0: USB hub found
[ 16.526416] hub 2-0:1.0: 1 port detected
[ 16.853481] usb 2-1: new high-speed USB device number 2 using ci_hdrc
[ 17.014197] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 17.034759] scsi host0: usb-storage 2-1:1.0
[ 17.343434] usb 2-1: USB disconnect, device number 2
[ 17.633467] usb 2-1: new high-speed USB device number 3 using ci_hdrc
[ 17.794203] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 17.813568] scsi host1: usb-storage 2-1:1.0
[ 18.150407] usb 2-1: USB disconnect, device number 3
[ 18.433486] usb 2-1: new high-speed USB device number 4 using ci_hdrc
[ 18.594197] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 18.613572] scsi host2: usb-storage 2-1:1.0
[ 18.958404] usb 2-1: USB disconnect, device number 4
[ 19.243495] usb 2-1: new high-speed USB device number 5 using ci_hdrc
[ 19.404199] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 19.423567] scsi host3: usb-storage 2-1:1.0
[ 19.766400] usb 2-1: USB disconnect, device number 5
[ 20.053460] usb 2-1: new high-speed USB device number 6 using ci_hdrc
[ 20.214189] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 20.233568] scsi host4: usb-storage 2-1:1.0
[ 20.574400] usb 2-1: USB disconnect, device number 6
[ 20.863482] usb 2-1: new high-speed USB device number 7 using ci_hdrc
[ 21.024202] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 21.043618] scsi host5: usb-storage 2-1:1.0
[ 21.382407] usb 2-1: USB disconnect, device number 7
[ 21.673483] usb 2-1: new high-speed USB device number 8 using ci_hdrc
[ 21.834198] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 21.853568] scsi host6: usb-storage 2-1:1.0
[ 22.189413] usb 2-1: USB disconnect, device number 8
[ 22.473483] usb 2-1: new high-speed USB device number 9 using ci_hdrc
[ 22.634200] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 22.653756] scsi host7: usb-storage 2-1:1.0
[ 22.997402] usb 2-1: USB disconnect, device number 9
Hi qiang
reason may be in hardware: please check that ID was low on both sides:
(in i.MX USB host mode ID pin should be low)
>2.OTG连接U盘,测量到ID pin上的电阻,一边为低电平,另一边为高电平。
2. The OTG is connected to the USB flash drive and the resistance on the
ID pin is measured. One side is low and the other side is high.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov,
I want to confirm one questions:
1. when OTG disconnect anything, what the state of ID pin?
Hi igorpadykov,
I just measure the ID pin again. when OTG connect to the USB flash drive, the ID pin keeps low, there is no problem.
but the log seems strange? can you help me?
could you try other usb sticks and try with Demo Images from link
Best regards
igor
so you think may this's the software problem, or the usb driver problem.
reason may be both, one can try to narrow down problem using given suggestions.
Best regards
igor