【平台:】 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: [color=#FF0000]DeviceFailedEnumeration[/color]
- 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分了