上电前插USB开机后无法识别问题总结

在CSDN上看到了相关的贴子。这里总结下:

我们的平台usb设备电源是上电后就一直供应的,这样造成了一些上电前插入的USB设备在系统启动后无法识别,必须重新插拔一次.有些设备又可以正常识别.
DEBUG usb 驱动发现,usb驱动在初始化的时候会查询每个端口的状态,并且会尝试枚举设备,但是上电前插入的设备在GetDescriptor的时候会失败,失败后usb驱动会执行ResetAndPoweronPort,再进行尝试,在失败3次以后就会DisablePort,造成无法识别设备. 重新插拔一次后,在GetDescriptor的时候就可以正常返回,枚举设备成功.
现在硬件已经做好,没有办法通过控制usb电源,或者拉低拉高数据线来模拟usb插拔.有没有人遇到过这种问题,有没有什么通过修改usb驱动的办法能解决它呢.

I am running Windows CE 5.0 with all available QFEs (including January 2008)
on a Samsung SMDK2410 CPU.

I have a problem with the USB OHCI (1.1) Host Controler:
-start device with a USB device attached to the single OHCI (USB 1.1) Host
Controller port
-occasionally (approximately 5-10 times out of 400 starts) the USB device is
not recognized

The problem occurs in the CHub::AttachDevice() function
(…\DRIVERS\USB\HCD\COMMON\cdevice.cpp):
-in the state machine in the
DEVICE_CONFIG_STATUS_SCHEDULING_GET_DEVICE_DESCRIPTOR_TEST step, I get an
USB_DEVICE_NOT_RESPONDING_ERROR (= 0x5).
-now the state machine goes back to the
DEVICE_CONFIG_STATUS_RESET_AND_ENABLE_PORT state and tries 2 more times
-ultimately after the 3 reties get the same error message the attach fails

The only way that I found to fix that problem is:
-physically unplugging the USB device and plugging it back in
-rebooting the system

Both solutions are not an option for me!

I also tried:
-more reties (10)
-timeout (100ms) before each retry
-powering off and repowering USB port between the reties
-making CHub::HubStatusChangeThread() belief the device was unplugged so do
a DetachDevice() and then (even after powering off and repowering the USB
port) let CHub::HubStatusChangeThread() do the AttachDevice() again

With all of these attempts the problem persisted: the device descriptor
could not be retrieved and the attach failed.

Any help is appreciated

Thanks
-Jochen
还有就是用下面这个比较好!: Sleep(m_portBase->HcRhDescriptorA.POTPGT * 2); Sleep(m_portBase->HcRhDescriptorA.POTPGT * 2);

转载于:https://www.cnblogs.com/sankye/articles/1584487.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值