【usb 总线枚举失败! 《usb function driver》问题如何排查!】

-小仙- 2009-12-25 09:53:44
加精
【平台:】 2440+wince5.0
【目的】:实现CE 设备在USB与PC连线的情况下显示为 移动设备(U盘)的功能! 因为我的BSP中的usb function的driver只有serial的功能 无法通过简单的注册表更改实现切换!所以不得不自己移植sb function driver!(我是从samsug 官方bsp下的usbfn 移植到当前BSP下,)因为他的release note 有说明:
The USB Mass Storage Function driver was implemented.
The USB driver was updated to support the USB Mass Storage Function. And, the usbmsfn.dll was added in the files folder. So, it can support both the Serial and the Mass Storage Function Class.
【现象:】
用 usb view 软件查看CE DEVICE 得到如下信息:


/*
Device Descriptor:
bcdUSB: 0x0000
bDeviceClass: 0x00
bDeviceSubClass: 0x00
bDeviceProtocol: 0x00
bMaxPacketSize0: 0x00 (0)
idVendor: 0x0000
idProduct: 0x0000
bcdDevice: 0x0000
iManufacturer: 0x00
iProduct: 0x00
iSerialNumber: 0x00
bNumConfigurations: 0x00

ConnectionStatus: DeviceFailedEnumeration
Current Config Value: 0x00
Device Bus Speed: Low
Device Address: 0x00
Open Pipes: 0
*/



DeviceFailedEnumeration 说明是枚举失败了!

-------------------------------------
下面是在function 的功能为mass storage的时候的打印信息:

UsbFnMdd!DllEntry: Attach
-->UfnPdd_DllEntry()
->UfnPdd_Init()
SC2440UsbFn!UfnPdd_Init: ++
pdd->unVersion=0x50000
RegOpenKeyEx success 0, 1, Mass_Storage_Class, 38
RegQueryValueEx success
USB MSF Function Class Enabled : Mass_Storage_Class
no sysintr index specified
SC2440UsbFn!UfnPdd_Init: Using irq 0x19
SC2440UsbFn!UfnPdd_Init: Using IO Base 0xb1200000
SC2440UsbFn!UfnPdd_Init: Using SysIntr 0x28
SC2440UsbFn!UfnPdd_Init: Using IST priority 0d100
MapRegisterSett
SC2440UsbFn!MapRegisterSet: ++
SC2440UsbFn!MapRegisterSet: VirtualCopy Succeeded, pVMem:400000
SC2440UsbFn!MapRegisterSet: --
SC2440UsbFn!ResetDevice: ++
SC2440UsbFn!ResetEndpoint: ++
SC2440UsbFn!ResetEndpoint: --
SC2440UsbFn!ResetEndpoint: ++
SC2440UsbFn!DisableEndpointInterrupt: ++
SC2440UsbFn!DisableEndpointInterrupt: --
SC2440UsbFn!ResetEndpoint: --
SC2440UsbFn!ResetEndpoint: ++
SC2440UsbFn!DisableEndpointInterrupt: ++
SC2440UsbFn!DisableEndpointInterrupt: --
SC2440UsbFn!ResetEndpoint: --
SC2440UsbFn!ResetEndpoint: ++
SC2440UsbFn!DisableEndpointInterrupt: ++
SC2440UsbFn!DisableEndpointInterrupt: --
SC2440UsbFn!ResetEndpoint: --
SC2440UsbFn!ResetEndpoint: ++
SC2440UsbFn!DisableEndpointInterrupt: ++
SC2440UsbFn!DisableEndpointInterrupt: --
SC2440UsbFn!ResetEndpoint: --
SC2440UsbFn!ResetDevice: --
SC2440UsbFn!UfnPdd_Init: --
judge->UFN_PDD_INTERFACE_VERSION=0x50000
UsbFnMdd!UFN_Init: PDD has 5 endpoints
UsbFnMdd!UFN_Init: PDD supports speeds 0x1
SC2440UsbFn!UfnPdd_IOControl: ++
SC2440UsbFn!UfnPdd_IOControl: --
UsbFnMdd!CUfnBus::GetDefaultClientName: Using default client key named "DefaultClientDriver"
UsbFnMdd!CUfnBus::CreateChild: Using client driver key "\Drivers\USB\FunctionDrivers\Mass_Storage_Class"
UsbMsFn!DllEntry: Attached
bot.cpp-->Init()
-->BOT_InternalInit
UsbMsFn!BOT_InternalInit: ++
UsbMsFn!BOT_Configure: ++
UsbMsFn!BOT_ReadConfigurationValue: ++
UsbMsFn!BOT_ReadConfigurationValue: --
UsbMsFn!BOT_Configure: --
SC2440UsbFn!UfnPdd_IsConfigurationSupportable: ++
SC2440UsbFn!UfnPdd_IsConfigurationSupportable: --
SC2440UsbFn!UfnPdd_IsEndpointSupportable: ++
SC2440UsbFn!UfnPdd_IsEndpointSupportable: --
SC2440UsbFn!UfnPdd_IsEndpointSupportable: ++
SC2440UsbFn!UfnPdd_IsEndpointSupportable: --
UsbFnMdd!IsInterfaceSupportable: Endpoint index 0 can be supported by physical endpoint 1
SC2440UsbFn!UfnPdd_IsEndpointSupportable: ++
SC2440UsbFn!UfnPdd_IsEndpointSupportable: --
UsbFnMdd!IsInterfaceSupportable: Endpoint index 1 can be supported by physical endpoint 2
UsbFnMdd!UfnMdd_RegisterDevice: Device registered
---->now Read transfer thread priority from registry
UsbMsFn!BOT_ReadConfigurationValue: ++
UsbMsFn!BOT_ReadConfigurationValue: --
UsbMsFn!BOT_InternalInit: BOT transfer thread priority = 100
---->now call CeSetThreadPriority()
UsbMsFn!BOT_TransferThread: ++
---->now call BOT_DeviceNotify()
//这里并没有实际进入BOT_DeviceNotify()函数! 次函数在BOT_InternalInit()中被调用
SC2440UsbFn!UfnPdd_InitEndpoint: ++
SC2440UsbFn!UfnPdd_IsEndpointSupportable: ++
SC2440UsbFn!UfnPdd_IsEndpointSupportable: --
SC2440UsbFn!UfnPdd_InitEndpoint: --
SC2440UsbFn!UfnPdd_IOControl: ++
usb->SetPowerState(.
usb->HW_USBClocks.
HW_USBClocks::D0
SC2440UsbFn!UfnPdd_IOControl: --
->UfnPdd_Start
SC2440UsbFn!UfnPdd_Start: ++
SC2440UsbFn!UfnPdd_Start: ++
-dwSysIntr=28
USBD enable interrutp
::: SYSINTR_USBD OEMInterruptDone
SC2440UsbFn!UfnPdd_Start: --
<-UfnPdd_Start
UsbFnMdd!UfnMdd_Start: Function controller running
UsbMsFn!BOT_InternalInit: --
<--BOT_InternalInit
<-BOT_InternalInit,,,dwRet==true
usb->enter interrupt sevice routine.
UsbFnMdd!CUfnBus::ActivateChild: Activated client driver "Mass_Storage_Class"
SC2440UsbFn!ISTMain: ++
SC2440UsbFn!EnableEndpointInterrupt: ++
SC2440UsbFn!EnableEndpointInterrupt: --


---
USBD的中断可以相应! 但目前没有任何反应在PC端!

现在不知道该怎么排查和解决了? 请坛友帮忙!非常感谢! 只有65分了

...全文
916 39 打赏 收藏 转发到动态 举报
写回复
用AI写文章
39 条回复
切换为时间正序
请发表友善的回复…
发表回复
michaell2008 2011-07-05
  • 打赏
  • 举报
回复
我现在也在做和楼主当时一样的工作,也遇到了这个问题。就是
BYTE bEpIrqStat = ReadReg(pContext, EP_INT_REG_OFFSET);
BYTE bUSBBusIrqStat = ReadReg(pContext, USB_INT_REG_OFFSET);
这两个值读回来都是0。请问楼主当时是怎么解决的,万分感谢。
MORGAN_ZHANG 2010-04-21
  • 打赏
  • 举报
回复
MARK IT!
clairedanes 2010-01-03
  • 打赏
  • 举报
回复
好高级的啊 不懂 帮顶下
sd363660578 2010-01-03
  • 打赏
  • 举报
回复
学习,虽然不懂,但觉得很有意思。。。。
xumercury 2010-01-02
  • 打赏
  • 举报
回复
mark
lhl6812272 2010-01-02
  • 打赏
  • 举报
回复
很好
shaonew 2009-12-31
  • 打赏
  • 举报
回复
marks
  • 打赏
  • 举报
回复
up
-小仙- 2009-12-30
  • 打赏
  • 举报
回复
怎么没人呢?帮忙啊!
现在吧SD卡 做为移动磁盘 ,打印信息如下:
UsbMsFn!STORE_Init: ++
UsbMsFn!STORE_Init: DeviceName = DSK3:
UsbMsFn!STORE_Init: Removable = 0
UsbMsFn!STORE_Init: opened store DSK3:
UsbMsFn!STORE_Init: IOCTL_DISK_GETINFO failed; error = 87
UsbMsFn!STORE_Init: DISK_IOCTL_GETINFO passed
UsbMsFn!STORE_Init: bytes per sector = 512
UsbMsFn!STORE_Init: cylinders = 0
UsbMsFn!STORE_Init: flags = 0xb
UsbMsFn!STORE_Init: heads = 0
UsbMsFn!STORE_Init: sectors = 0
UsbMsFn!STORE_Init: total sectors = 498176
UsbMsFn!STORE_Init: --

-------
能收到主机发过来的GET DESCRIPTR 请求:
UsbFnMdd!UfnMdd_Notify: Received setup packet: 80 06 0100 0000 0040
UsbFnMdd!ProcessRequest: ++
UsbFnMdd!ProcessGetDescriptor: ++
UsbFnMdd!ProcessGetDescriptor: Get device descriptor request.

按理说应该收到回应信息在PC端,但现在依旧是:
11 CTL a3 00 00 00 - 01 00 04 00 CLASS 27ms 85.1.0
11 DI 03 01 10 00 .... 32us 85.2.0
11 CTL 23 01 14 00 - 01 00 00 00 CLASS 2us 86.1.0
11 CTL a3 00 00 00 - 01 00 04 00 CLASS 27ms 87.1.0
11 DI 03 01 00 00 .... 41us 87.2.0
11 CTL a3 00 00 00 - 01 00 04 00 CLASS 21ms 88.1.0
11 DI 03 01 00 00 .... 27us 88.2.0
---
下面不知道怎么分析了!
我想这个USB FUNCTION的驱动是samsug bsp里面的说明是写好,并测试通过的! 那么内部的操作应该可以不用理会,主要是配置方面的问题,比如注册表中的地址和中断的配置,
但现在都可以走到这里了 说明中断和地址是OK的!
在ActiveSync 链接的时候idVendor: 是0x0547。而我此时用的是 "idVendor"=dword:045E所以不会有冲突的!
在CE端SD卡的盘符也消失了!

Q:依旧是PC段枚举设备失败
wwwwwwwwqqqqqq 2009-12-30
  • 打赏
  • 举报
回复
我也来看看,呵呵
-小仙- 2009-12-30
  • 打赏
  • 举报
回复
孤独的一个人~!
q5155331 2009-12-30
  • 打赏
  • 举报
回复
顶!!!!!!!!
tata1025 2009-12-30
  • 打赏
  • 举报
回复
跑过看看
luixing67 2009-12-30
  • 打赏
  • 举报
回复
study
-小仙- 2009-12-30
  • 打赏
  • 举报
回复

AiXed 2009-12-29
  • 打赏
  • 举报
回复
mark




aosgirl 2009-12-29
  • 打赏
  • 举报
回复
嵌入式wince的技术问题可以到海同嵌入式技术网站上在线提问。有技术老师回答的。
xiaohunender 2009-12-29
  • 打赏
  • 举报
回复
学习了~~~
lishuai000 2009-12-29
  • 打赏
  • 举报
回复
很不错
zhyzdl 2009-12-28
  • 打赏
  • 举报
回复
study
加载更多回复(17)

19,504

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧