阅读:6746回复:20
如何把CE Device当作U盘?
请问WinCE5.0上如何把CE Device在连接PC后,当作U盘?
看到很多大侠已经实现了: “WinCE5有,支持那个U盘的。那个core os service下面那个usb host support加一个usb storeage class driver,然后加一个device drivers下面的usb fuction clients的一个mass storage就可以了 ,当然ohci之类的要选上。” 只加上这些就可以了吗?,但是我加上了,PC端看不到U盘的盘符 偶尔有一次看到了盘符,却根本打不开。 注册表哪里需要改动吗? |
|
|
沙发#
发布于:2008-01-01 10:30
PS:我的CE Device已经有FAT32的分区了
|
|
|
板凳#
发布于:2008-01-01 11:15
用bus hound查看,是Timeout
4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 111.1.0 10ms 2008-01-01 03:06:33.163 4.0 LEN 04 00 00 00 4 111.2.0 29us 2008-01-01 03:06:33.163 4.0 DI 03 01 10 00 .... 111.3.0 2us 2008-01-01 03:06:33.163 4.0 CTL 23 01 14 00 04 00 00 00 CLEAR FEATURE 112.1.0 7us 2008-01-01 03:06:33.163 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 113.1.0(2) 25ms 2008-01-01 03:06:33.189 4.0 LEN 04 00 00 00 4 113.2.0 28us 2008-01-01 03:06:33.189 4.0 DI 03 01 00 00 .... 113.3.0 3us 2008-01-01 03:06:33.189 4.0 CTL 23 03 04 00 04 00 00 00 SET FEATURE 115.1.0 18ms 2008-01-01 03:06:33.207 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 116.1.0 10ms 2008-01-01 03:06:33.218 4.0 LEN 04 00 00 00 4 116.2.0 27us 2008-01-01 03:06:33.218 4.0 DI 03 01 10 00 .... 116.3.0 2us 2008-01-01 03:06:33.218 4.0 CTL 23 01 14 00 04 00 00 00 CLEAR FEATURE 117.1.0 7us 2008-01-01 03:06:33.218 19 CDB 28 00 00 00 00 00 00 00 01 00 READ 118.1.0 933ms 2008-01-01 03:06:34.152 19 SSTS 49 timeout 118.2.0 10sc 2008-01-01 03:06:44.153 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 119.1.0(3) 59us 2008-01-01 03:06:44.153 4.0 LEN 04 00 00 00 4 119.2.0 29us 2008-01-01 03:06:44.153 4.0 DI 03 01 00 00 .... 119.3.0 2us 2008-01-01 03:06:44.153 4.0 CTL 23 03 04 00 04 00 00 00 SET FEATURE 122.1.0 118us 2008-01-01 03:06:44.154 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 123.1.0 10ms 2008-01-01 03:06:44.164 4.0 LEN 04 00 00 00 4 123.2.0 29us 2008-01-01 03:06:44.164 4.0 DI 03 01 10 00 .... 123.3.0 2us 2008-01-01 03:06:44.164 4.0 CTL 23 01 14 00 04 00 00 00 CLEAR FEATURE 124.1.0 7us 2008-01-01 03:06:44.164 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 125.1.0(2) 26ms 2008-01-01 03:06:44.191 4.0 LEN 04 00 00 00 4 125.2.0 37us 2008-01-01 03:06:44.191 4.0 DI 03 01 00 00 .... 125.3.0 2us 2008-01-01 03:06:44.191 4.0 CTL 23 03 04 00 04 00 00 00 SET FEATURE 127.1.0 18ms 2008-01-01 03:06:44.209 4.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 128.1.0 10ms 2008-01-01 03:06:44.220 4.0 LEN 04 00 00 00 4 128.2.0 19us 2008-01-01 03:06:44.220 4.0 DI 03 01 10 00 .... 128.3.0 3us 2008-01-01 03:06:44.220 4.0 CTL 23 01 14 00 04 00 00 00 CLEAR FEATURE 129.1.0 6us 2008-01-01 03:06:44.220 19 CDB 28 00 00 00 00 00 00 00 01 00 READ 130.1.0 932ms 2008-01-01 03:06:45.153 19 SSTS 49 timeout 130.2.0 10sc 2008-01-01 03:06:55.158 |
|
|
地板#
发布于:2008-01-14 21:59
现在,如果我插上SD卡PC上会有盘符
我看了调试的信息,前面的都正常,后面的有问题 0x8dfccb90: CStore Destructor(000D7EA0) 0x8dfccb90: SDMemory: GetDeviceInfo - Profile = SDMemory, length = 18 0x8dfccb90: SDMemory: GetStorageID Insufficient buffer space SDMemory: -GetStorageID 0x8dfccb90: Loading partition driver mspart.dll hModule=8DF8D264 0x8dfccb90: Driver mspart.dll loaded 0x8dd13550: UsbFnMdd!CPipe::Open: Opened pipe (0x004dcff8): physical address 1, bus address 0x81 0x8dd13550: UsbFnMdd!UfnMdd_OpenPipe: Opened endpoint 0x81 0x8dd13550: UsbFnMdd!CPipe::Open: Opened pipe (0x004dd070): physical address 2, bus address 0x02 0x8dd13550: UsbFnMdd!UfnMdd_OpenPipe: Opened endpoint 0x2 0x8dd29b98: UsbMsFn!ProcessScsiRead10: IOCTL_DISK_READ failed; error = 160 0x8dd29b98: UsbMsFn!STORE_ExecuteCommand: failed to execute command 0x28 0x8dd29b98: UsbMsFn!BOT_ExecuteCB: Command : failed 0x8dfccb90: Opened the store hStore=000D8DE0 0x8dfccb90: NumSec=1939456 BytesPerSec=512 FreeSec=0 BiggestCreatable=0 0x8dfccb90: Partition Part00 NumSectors=1939454 0x8dfccb90: MSPART!PD_OpenPartition: dwStoreId=000D8DE0, PartName=Part00 0x8dfccb90: FSD_MountDisk: mounting volumes for hDsk=000DB100 0x8dfccb90: SDMemory: GetDeviceInfo - Profile = SDMemory, length = 18 0x8de87000: FSREG: Invalid HKEY 0x00000000 0x8de87000: FSREG: Invalid HKEY 0x00000000 0x8dd29b98: UsbMsFn!ProcessScsiRead10: IOCTL_DISK_READ failed; error = 160 0x8dd29b98: UsbMsFn!STORE_ExecuteCommand: failed to execute command 0x28 0x8dd29b98: UsbMsFn!BOT_ExecuteCB: Command : failed |
|
|
地下室#
发布于:2008-01-14 23:08
查了WINERROR.H
// MessageId: ERROR_BAD_ARGUMENTS // MessageText: // One or more arguments are not correct. #define ERROR_BAD_ARGUMENTS 160L 错误发生处 DWORD dwIoControlCode = (g_fLegacyBlockDriver) ? DISK_IOCTL_READ : IOCTL_DISK_READ; fResult = DeviceIoControl( g_hStore, dwIoControlCode, &sgSgReq, sizeof(sgSgReq), NULL, 0, &dwBytesReturned, NULL); if (fResult) { DEBUGMSG(ZONE_COMMENT, (_T( "%s IOCTL_DISK_READ passed; %u bytes read\r\n" ), pszFname, dwBytesReturned)); } else { DWORD dwError = GetLastError(); DEBUGMSG(ZONE_ERROR, (_T( "%s IOCTL_DISK_READ failed; error = %u\r\n" ), pszFname, dwError)); goto EXIT; } |
|
|
5楼#
发布于:2008-01-15 15:29
[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:045E "Manufacturer"="Generic Manufacturer (PROTOTYPE--Remember to change idVendor)" "idProduct"=dword:FFFF "Product"="Generic Mass Storage (PROTOTYPE--Remember to change idVendor)" "bcdDevice"=dword:0 ; @CESYSGEN ENDIF CE_MODULES_USBMSFN 注册表中, "DeviceName"="DSK1:"代表你要通过USB口打开的器件。 组件里面好像还缺少一个 thirdbsp->usbfunction |
|
6楼#
发布于:2008-01-15 16:44
谢谢楼上的,我用的是2440
thirdbsp->usb function->usb Function Bus Driver->Samsung 2440A CSP已添加进去了 DSK1现在是SD Card 我现在希望通过USB在PC上打开SD Card。 插上USB后,PC上有移动磁盘的盘符,但是双击打不开,提示要插入磁盘 串口一直输出: 0x8dd29b98: UsbMsFn!ProcessScsiRead10: IOCTL_DISK_READ failed; error = 160 0x8dd29b98: UsbMsFn!STORE_ExecuteCommand: failed to execute command 0x28 0x8dd29b98: UsbMsFn!BOT_ExecuteCB: Command : failed |
|
|
7楼#
发布于:2008-01-15 17:25
我用的是AU1200,2440就不清楚了。
仿佛是2440的USB驱动没有被调用到。 |
|
8楼#
发布于:2008-01-16 11:36
在CE Device中使用SD 卡,没问题? 如果是这样的既有可能出在USB Device驱动,或者USB Device硬件上以及与PC主机的连接上; 如果你拿到的2440 USB Device驱动在其它的板子上没问题的话,应该就出在你的硬件上或者与PC主机连接上了; 你可以更换PC机以及USB插口(电气特性上的不配比)
|
|
|
9楼#
发布于:2008-01-18 10:42
thx, thinkerwin
CE Device中使用SD 卡,没问题的 其他方面我再试试 |
|
|
10楼#
发布于:2008-01-18 10:52
貌似那东西只支持把SD开放成U盘
要开放nand 需要自己改驱动 |
|
|
11楼#
发布于:2008-01-18 13:46
我想把WINCE的内存通过USB Device开放了,这样就可以实际测出到底Device的USB速度,sniper167老兄有什么好的办法,好像前段时间你也在搞这个问题的说。
|
|
12楼#
发布于:2008-01-18 15:44
我那是在4.2上 只开放了SD卡
开放内存这个。。。。 我还从没想过 完全没头绪 |
|
|
13楼#
发布于:2008-01-18 18:26
那有没有办法检测CE 下USB2.0 device的速度的,activesync太慢,开放SD卡又受到SD卡速度的约束,不知如何是好。
|
|
14楼#
发布于:2008-01-18 21:38
在CE Device中使用SD 卡,没问题。
USB Device驱动使用三星原来的。 USB Device硬件可以传输数据,应该没问题。 拿到的2440 USB Device驱动在其它的板子上也有问题。 PC机可以读U盘,应该不是PC的USB接口有问题。 USB Device与PC主机的连接上,这个怎么确定是否有问题? 现在SD卡在PC上还是无法打开,只有盘符出现,双击提示要插入磁盘 串口输出: 0x8dd29b98: UsbMsFn!ProcessScsiRead10: IOCTL_DISK_READ failed; error = 160 0x8dd29b98: UsbMsFn!STORE_ExecuteCommand: failed to execute command 0x28 0x8dd29b98: UsbMsFn!BOT_ExecuteCB: Command : failed 找到问题是 fResult = DeviceIoControl( g_hStore, dwIoControlCode, &sgSgReq, sizeof(sgSgReq), NULL, 0, &dwBytesReturned, NULL); 错误原因160 ,是参数有问题 可这段代码是\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\STORAGE\EMULATION\SCSI2\BLOCK\block.cpp中的啊, 如果这个有问题,那因该有人遇到过把 各位在PC上识别出SD卡的有遇到过这个问题吗? |
|
|
15楼#
发布于:2008-01-19 09:52
\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\STORAGE\EMULATION\SCSI2\BLOCK\block.cpp中的代码没有问题。
你可以将open的那条语句打印出来,看是否打开了SD卡,如果打开了, 那应该是2440的驱动有问题。 |
|
16楼#
发布于:2008-01-19 13:42
open已经打开了
0x8dd13550: UsbMsFn!STORE_Init: DeviceName = DSK1: 0x8dd13550: UsbMsFn!STORE_Init: Removable = 1 0x8dd13550: UsbMsFn!STORE_Init: IOCTL_DISK_GETINFO passed 0x8dd13550: UsbMsFn!STORE_Init: bytes per sector = 512 0x8dd13550: UsbMsFn!STORE_Init: cylinders = 0 0x8dd13550: UsbMsFn!STORE_Init: flags = 0xb 0x8dd13550: UsbMsFn!STORE_Init: heads = 0 0x8dd13550: UsbMsFn!STORE_Init: sectors = 0 0x8dd13550: UsbMsFn!STORE_Init: total sectors = 1939456 “2440的驱动有问题”,你指的是USB驱动部分有问题吗? |
|
|
17楼#
发布于:2008-01-19 15:58
STORE_Init中的顺序是
1. open store 2.read disk information 3. dismount entire store (all partitions) 这些都成功了 但是,unmount后,又重新mount了,不知道为什么,CE device端看到SD卡盘符一闪一闪的 表明不断的被unmount,再mount 0x8dd13550: UsbMsFn!STORE_Init: DeviceName = DSK1: 0x8dd13550: UsbMsFn!STORE_Init: Removable = 1 0x8dd13550: UsbMsFn!STORE_Init: IOCTL_DISK_GETINFO passed 0x8dd13550: UsbMsFn!STORE_Init: bytes per sector = 512 0x8dd13550: UsbMsFn!STORE_Init: cylinders = 0 0x8dd13550: UsbMsFn!STORE_Init: flags = 0xb 0x8dd13550: UsbMsFn!STORE_Init: heads = 0 0x8dd13550: UsbMsFn!STORE_Init: sectors = 0 0x8dd13550: UsbMsFn!STORE_Init: total sectors = 1939456 0x8dd13550: FSD_UnmountDisk(0xdbb50): unmounting... 0x8dd13550: FATFS!UnmountDisk: unmounting all volumes on disk 000DBB50 0x8dfccb90: CStore Destructor(000D7EA0) 0x8dfccb90: SDMemory: GetDeviceInfo - Profile = SDMemory, length = 18 0x8dfccb90: SDMemory: GetStorageID Insufficient buffer space SDMemory: -GetStorageID 0x8dfccb90: Loading partition driver mspart.dll hModule=8DF8D264 0x8dfccb90: Driver mspart.dll loaded 0x8dfccb90: Opened the store hStore=000D8DE0 0x8dfccb90: NumSec=1939456 BytesPerSec=512 FreeSec=0 BiggestCreatable=0 0x8dfccb90: Partition Part00 NumSectors=1939454 0x8dfccb90: MSPART!PD_OpenPartition: dwStoreId=000D8DE0, PartName=Part00 0x8dfccb90: FSD_MountDisk: mounting volumes for hDsk=000DB3A0 0x8dfccb90: SDMemory: GetDeviceInfo - Profile = SDMemory, length = 18 0x8dfccb90: FATFS!OpenVolume: access time updates disabled 0x8dfccb90: FATFS!OpenVolume: event logging enabled 0x8dfccb90: FATFS!OpenVolume: automatic scanning disabled 0x8db4ddb8: FATFS!FAT_GetFileAttributesW(\Windows\ceshell.dll) returned 0xffffffff (3) 0x8dfccb90: FATFS!OpenVolume: write verify disabled 0x8db4ddb8: FATFS!FAT_CreateFileW(\Windows\ceshell.dll) returned 0x0 (3) 0x8dfccb90: FATFS!OpenVolume: extra FAT on format disabled 0x8db4ddb8: FATFS!FAT_GetFileAttributesW(\Windows\ceshell.dll) returned 0xffffffff (3) 0x8dfccb90: FATFS!OpenVolume: force write through enabled 0x8db4ddb8: FATFS!FAT_CreateFileW(\Windows\ceshell.dll) returned 0x0 (3) 0x8dfccb90: FATFS!OpenVolume: Codepage = 1 0x8db4ddb8: FATFS!FAT_GetFileAttributesW(\Windows\ceshell.dll) returned 0xffffffff (3) 0x8dfccb90: FATFS!OpenVolume: Number of path cache entries = 50 0x8db4ddb8: FATFS!FAT_CreateFileW(\Windows\ceshell.dll) returned 0x0 (3) 0x8dfccb90: CreateCache: Successful. Cache Size: 256 KB, Start: 32, End: 1925. 0x8dfccb90: CreateCache: Successful. Cache Size: 512 KB, Start: 1926, End: 1939453. 0x8dfccb90: FATFS!InitVolume: FAT version: 32 0x8dfccb90: FATFS!InitVolume: Cluster Size (Sectors): 8 0x8dfccb90: FS: Registering file system Storage Card, index 0, flags 0x00000000 0x8dfccb90: FS: Mount complete (Storage Card, index 0, flags 0x00000000) |
|
|
18楼#
发布于:2008-01-20 23:27
问一下
\WINCE500\public\common\oak\drivers\sdcard\SDClientDrivers\SDMemory\SDMemMain.cpp中有一个 SMC_IOControl( DWORD Handle, DWORD IoctlCode, PBYTE pInBuf, DWORD InB ufSize, PBYTE pOutBuf, DWORD OutBufSize, PDWORD pBytesReturned) 这个SMC_IOControl是谁来调用呢? 怎么找不到啊 |
|
|
19楼#
发布于:2008-03-28 06:28
回 楼主(dapli)的帖子
朋友, 问题如何解决的呢? 是USB Device驱动的问题吗? 谢谢分享! |
|
上一页
下一页