[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
"Dll"="usbmsfn.dll"
"InterfaceSubClass"=dword:06
"InterfaceProtocol"=dword:50
"DeviceName"="DSK1:"
"FriendlyName"="Mass Storage"
; idVendor must be changed. 045E belongs to Microsoft and is only to be used for
; prototype devices in your labs. Visit http://www.usb.org to obtain a vendor id.
"idVendor"=dword:0547
"Manufacturer"="Generic Manufacturer (PROTOTYPE--Remember to change idVendor)"
"idProduct"=dword:2720
"Product"="Generic Mass Storage (PROTOTYPE--Remember to change idVendor)"
"bcdDevice"=dword:0
等等。
在添加组件的时候也选上core os service下面那个usb host support,usb storeage class driver,在Catalog Items View中还选择”Device Drivers”->”USB Function”->”USB Function Clients”->”Mass Storage”。但是还是没起作用。
碰到的问题是:插上USB时,串口会打印一系列信息,从这些信息可以看出sc2410_usb_ser.c和sc2410_usb_hw.c都运行到了,但是在“设备管理器”里看到的确是“wince usb device”,并没有被识别为mass storage。感觉好象usbmsfn.dll根本没有起作用,因为bot.cpp里的调试信息并没被打印出来,而从source文件看bot.cpp是构成usbmsfn.dll的组成部分。如果我把注册表项:[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USB]
"Dll"="sc2410_usb_ser.Dll"
"IoBase"=dword:B1200000
"Irq"=dword:B
"IoLen"=dword:130
"Tsp"="Unimodem.dll"
"DeviceArrayIndex"=dword:0
"Prefix"="COM"
"Order"=dword:2
"DeviceType"=dword:0
"FriendlyName"="SC2410 USB Cable:"
; Eliminate flow control bit
"DevConfig"=hex: 10,00,00,00,05,00,00,00,00,01,00,00,00,4B,00,00,00,00,08,00,00,00,00,00,00
注释掉的话,插上USB,串口没有任何调试信息输出,PC机显示无法识别的USB设备。
我的疑惑是:(1)usbmsfn.dll到底和sc2410_usb_ser.dll有没有关系?我的理解是usbmsfn.dll是MDD层的东西,它应该要调用底层的东西,底层的东西是不是在BSP包smdk2410\DRIVERS\USB\FUNCTION里,但是这个文件夹里又只有sc2410_usb_hw.c和sc2410_usb_ser.c,这两个文件是生成sc2410_usb_ser.dll的。
(2)怎么让usbmsfn.dll被正确加载并被调用?让程序跑到bot.cpp里?感觉要是跑到bot.cpp里应该就快成功了。插上USB后wince的整个调用机制是怎样的?