我用的是PXA310的平台,WINCE是6.0。现在打算把平台的FLASH作为U盘供PC访问,但是一直无法实现,表现是:插上USB先后,PC能找到MASS_Storage,并装载驱动,但是装载后PC端只能看到盘符,可以打开,但是没有内容,显示0字节,点击“格式化”没有任何反应。此时WINCE平台上FLASH应该已经卸载,用“我的设备”查看已经没有任何内容。
注册表内容已经按照网上的方式进行了设置,DeviceName设为了DSK1:,是FLASH设备的号,默认的方式是MASS_STORAGE_CLASS,如下:
USB相关设置:
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
"DefaultClientDriver"=-
"DefaultClientDriver"="Mass_Storage_Class"
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
"Dll"="usbmsfn.dll"
"idvendor"=dword:1286
"idProduct"=dword:A6CD
"Product"="Marvell Mass Storage"
"Manufacturer"="Marvell"
"InterfaceSubClass"=dword:06
"InterfaceProtocol"=dword:50
"DeviceName"="DSK1:"
"Removable"=dword:1
FLASH相关设置:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MSFlash]
"Prefix"="DSK"
"Dll"="$(_TGTPLAT_PFX)_nandflsh.dll"
"Index"=dword:1
"Order"=dword:1 ; Must follow the MFP
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"Profile"="MSFlash"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
"DriverPath"="Drivers\\BuiltIn\\MSFlash"
"LoadFlags"=dword:1
"BootPhase"=dword:0
"Order"=dword:0
"AutoMount"=dword:1
"AutoPart"=dword:1
"AutoFormat"=dword:1
; "PartitionDriver"=""
"Name"="MSFLASH for NAND FLASH"
"Folder"="Storage"
"MountAsBootable"=dword:1
;"MountAsROM"=dword:0
;"MountHidden"=dword:0
;"MountAsRoot"=dword:0
;"MountSystem"=dword:0
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
"MountAsBootable"=dword:1
"MountAsRoot"=dword:1
"Flags"=dword:00000014
"FormatTFAT"=dword:1
"EnableWriteBack"=dword:1
"CheckForFormat"=dword:1
"Util"="fatutil.dll"
插上USB线后,串口打印信息是:
---U2D OTGISR 0x608 otgusr 0x184c16
ULPI Read 0x13 value 0x16
*U2D OTGISR 0x608 otgusr 0x16
CLK_OP:: Disable
UpdateInput b_conn is 0
OTGSTATE:USBOTG_b_idle
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000001 - 0x00000000 from PDD
USB IoControl Stop
CLK_OP:: Disable
UpdateInput b_conn is 0
CLK_OP:: Disable
OTGSTATE:USBOTG_b_peripheral
USBOTG: set function pin
ULPI Write 0xc value 0x6
USBOTG: before reset controller , u2dcr is 100000
USB IoControl Reset
Device 0xd2768fe0 Is Loaded 1
UpdateInput a_conn is 1
Suspend Detected
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000001 - 0x00000003 from PDD
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000003 - 0x00000001 from PDD
USB Speed: FULL
Resume Detected
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000001 - 0x00000004 from PDD
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000003 - 0x00000002 from PDD
USB Speed: High
UsbFnMdd!UfnMdd_Notify: Ignoring notification 0x00000001 - 0x00000000 from PDD
Desktop Window QI, Unknown interfacehEvent has set.
UpdateInput a_conn is 1
USB Speed: FULL
UpdateInput a_conn is 1
QueryFormatPartition called now
BSP_ARGS_QUERY_FORMATPARTITION return 0
OALQueryFormatPartition return 0
USB Speed: High
Statll 1
USB Speed: FULL
UpdateInput a_conn is 1
QueryFormatPartition called now
BSP_ARGS_QUERY_FORMATPARTITION return 0
OALQueryFormatPartition return 0
USB Speed: High
USB Speed: FULL
我的FLASH没有进行分区,只有一个区。我试过使用存储管理器将这个区删除后划分成两个区,格式化成FAT16和FAT32的方式,但是效果是一样的,就是打印的时候多打印几次
QueryFormatPartition called now
BSP_ARGS_QUERY_FORMATPARTITION return 0
OALQueryFormatPartition return 0
9 个解决方案
#1
老问题就是不好解决啊……
#2
#3
1. LZ 的 flash page size 是多少, 必須 <= 4K
Paul, Chao @ Techware
Paul, Chao @ Techware
#4
这个帖子可以顶
#5
我的FLASH是 K9F2G08U0A ,page size应该是2k的。
Paul有什么建议吗?
#6
今天用BUSBOUND抓了下数据,发现在识别为Mass Storage后,就不太正常了,此时设备的FLASH已经卸载了,也无法操作了,而PC端发的消息就没有响应了。下面是捕获的信息,请大虾帮看看。
Device Length Phase Data Description Delta Cmd.Phase.Ofs(rep) Time Driver
------ -------- ----- -------------------------------------------------- ---------------- ----- ------------------ ------------ ------------
29.0 42 IN 2a 03 4d 00 61 00 72 00 76 00 65 00 6c 00 6c 00 *.M.a.r.v.e.l.l. 1.8ms 26.2.0 19:10:25.687
20 00 4d 00 61 00 73 00 73 00 20 00 53 00 74 00 .M.a.s.s. .S.t. 26.2.16
29.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 50ms 29.1.0 19:10:25.734 usbstor
29.0 18 IN 12 01 00 02 00 00 00 40 87 12 cd a6 00 00 01 02 .......@........ 2.0ms 29.2.0 19:10:25.734
00 01 .. 29.2.16
29.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 43us 30.1.0 19:10:25.734 usbstor
29.0 9 IN 09 02 20 00 01 01 00 c0 00 .. ...... 1.9ms 30.2.0 19:10:25.734
29.0 CTL 80 06 00 02 00 00 20 00 GET DESCRIPTOR 28us 31.1.0 19:10:25.734 usbstor
29.0 32 IN 09 02 20 00 01 01 00 c0 00 09 04 00 00 02 08 06 .. ............. 1.9ms 31.2.0 19:10:25.750
50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 P............... 31.2.16
29.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 31us 32.1.0 19:10:25.750 usbstor
29.0 CTL 01 0b 00 00 00 00 00 00 SET INTERFACE 36ms 33.1.0 19:10:25.781 usbstor
29.0 CTL a1 fe 00 00 00 00 01 00 GET MAX LUN 70ms 34.1.0 19:10:25.843 usbstor
29.0 1 IN 00 . 2.2ms 34.2.0 19:10:25.859
29.2 31 OUT 55 53 42 43 90 8a 2e 89 24 00 00 00 80 00 06 12 USBC....$....... 237us 35.1.0 19:10:25.859 usbstor
00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 ...$........... 35.1.16
29.1 36 IN 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 3.8ms 36.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 36.1.16
29.1 13 IN 55 53 42 53 90 8a 2e 89 00 00 00 00 00 USBS......... 116us 37.1.0 19:10:25.859 usbstor
29.2 31 OUT 55 53 42 43 90 8a 2e 89 fc 00 00 00 80 00 0a 23 USBC...........# 124us 38.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 fc 00 00 00 00 00 00 00 ............... 38.1.16
29.1 USTS c0000004 stall pid 444us 39.1.0 19:10:25.859 usbstor
29.1 RESET 17us 40.1.0 19:10:25.859 usbstor
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19sc 41.1.0 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 48us 41.2.0 19:10:45.609
29 RESET 42us 42.1.0 19:10:45.609 unknown
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 49us 43.1.0(2) 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 42us 43.2.0 19:10:45.609
24.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 91us 45.1.0 19:10:45.609 usbhub
24 0 IN 132ms 46.1.0 19:10:45.750 usbhub
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 32us 47.1.0 19:10:45.750 usbhub
24.0 4 IN 03 05 10 00 .... 45us 47.2.0 19:10:45.750
24.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 16us 48.1.0 19:10:45.750 usbhub
中间转换等待了19秒(红色)都没回应,是不是这里导致无法识别呢?
Device Length Phase Data Description Delta Cmd.Phase.Ofs(rep) Time Driver
------ -------- ----- -------------------------------------------------- ---------------- ----- ------------------ ------------ ------------
29.0 42 IN 2a 03 4d 00 61 00 72 00 76 00 65 00 6c 00 6c 00 *.M.a.r.v.e.l.l. 1.8ms 26.2.0 19:10:25.687
20 00 4d 00 61 00 73 00 73 00 20 00 53 00 74 00 .M.a.s.s. .S.t. 26.2.16
29.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 50ms 29.1.0 19:10:25.734 usbstor
29.0 18 IN 12 01 00 02 00 00 00 40 87 12 cd a6 00 00 01 02 .......@........ 2.0ms 29.2.0 19:10:25.734
00 01 .. 29.2.16
29.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 43us 30.1.0 19:10:25.734 usbstor
29.0 9 IN 09 02 20 00 01 01 00 c0 00 .. ...... 1.9ms 30.2.0 19:10:25.734
29.0 CTL 80 06 00 02 00 00 20 00 GET DESCRIPTOR 28us 31.1.0 19:10:25.734 usbstor
29.0 32 IN 09 02 20 00 01 01 00 c0 00 09 04 00 00 02 08 06 .. ............. 1.9ms 31.2.0 19:10:25.750
50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 P............... 31.2.16
29.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 31us 32.1.0 19:10:25.750 usbstor
29.0 CTL 01 0b 00 00 00 00 00 00 SET INTERFACE 36ms 33.1.0 19:10:25.781 usbstor
29.0 CTL a1 fe 00 00 00 00 01 00 GET MAX LUN 70ms 34.1.0 19:10:25.843 usbstor
29.0 1 IN 00 . 2.2ms 34.2.0 19:10:25.859
29.2 31 OUT 55 53 42 43 90 8a 2e 89 24 00 00 00 80 00 06 12 USBC....$....... 237us 35.1.0 19:10:25.859 usbstor
00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 ...$........... 35.1.16
29.1 36 IN 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 3.8ms 36.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 36.1.16
29.1 13 IN 55 53 42 53 90 8a 2e 89 00 00 00 00 00 USBS......... 116us 37.1.0 19:10:25.859 usbstor
29.2 31 OUT 55 53 42 43 90 8a 2e 89 fc 00 00 00 80 00 0a 23 USBC...........# 124us 38.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 fc 00 00 00 00 00 00 00 ............... 38.1.16
29.1 USTS c0000004 stall pid 444us 39.1.0 19:10:25.859 usbstor
29.1 RESET 17us 40.1.0 19:10:25.859 usbstor
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19sc 41.1.0 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 48us 41.2.0 19:10:45.609
29 RESET 42us 42.1.0 19:10:45.609 unknown
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 49us 43.1.0(2) 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 42us 43.2.0 19:10:45.609
24.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 91us 45.1.0 19:10:45.609 usbhub
24 0 IN 132ms 46.1.0 19:10:45.750 usbhub
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 32us 47.1.0 19:10:45.750 usbhub
24.0 4 IN 03 05 10 00 .... 45us 47.2.0 19:10:45.750
24.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 16us 48.1.0 19:10:45.750 usbhub
中间转换等待了19秒(红色)都没回应,是不是这里导致无法识别呢?
#7
进展怎么样了,你是一片nandflash吧,系统和boot都是放到这片nandflash吧,用了xip+binfs了吗,用了hive了吗
#8
没有什么进展,所以这几天忙别的去了,是一片nandflash,没有用xip,用了hive。
不知道是不是flash驱动还有点问题,在看usb协议……
不知道是不是flash驱动还有点问题,在看usb协议……
#9
问了好多人,才发现在PXA下没有几个能实现的,跟USB的通信都是通过activesync实现的……
#1
老问题就是不好解决啊……
#2
#3
1. LZ 的 flash page size 是多少, 必須 <= 4K
Paul, Chao @ Techware
Paul, Chao @ Techware
#4
这个帖子可以顶
#5
我的FLASH是 K9F2G08U0A ,page size应该是2k的。
Paul有什么建议吗?
#6
今天用BUSBOUND抓了下数据,发现在识别为Mass Storage后,就不太正常了,此时设备的FLASH已经卸载了,也无法操作了,而PC端发的消息就没有响应了。下面是捕获的信息,请大虾帮看看。
Device Length Phase Data Description Delta Cmd.Phase.Ofs(rep) Time Driver
------ -------- ----- -------------------------------------------------- ---------------- ----- ------------------ ------------ ------------
29.0 42 IN 2a 03 4d 00 61 00 72 00 76 00 65 00 6c 00 6c 00 *.M.a.r.v.e.l.l. 1.8ms 26.2.0 19:10:25.687
20 00 4d 00 61 00 73 00 73 00 20 00 53 00 74 00 .M.a.s.s. .S.t. 26.2.16
29.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 50ms 29.1.0 19:10:25.734 usbstor
29.0 18 IN 12 01 00 02 00 00 00 40 87 12 cd a6 00 00 01 02 .......@........ 2.0ms 29.2.0 19:10:25.734
00 01 .. 29.2.16
29.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 43us 30.1.0 19:10:25.734 usbstor
29.0 9 IN 09 02 20 00 01 01 00 c0 00 .. ...... 1.9ms 30.2.0 19:10:25.734
29.0 CTL 80 06 00 02 00 00 20 00 GET DESCRIPTOR 28us 31.1.0 19:10:25.734 usbstor
29.0 32 IN 09 02 20 00 01 01 00 c0 00 09 04 00 00 02 08 06 .. ............. 1.9ms 31.2.0 19:10:25.750
50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 P............... 31.2.16
29.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 31us 32.1.0 19:10:25.750 usbstor
29.0 CTL 01 0b 00 00 00 00 00 00 SET INTERFACE 36ms 33.1.0 19:10:25.781 usbstor
29.0 CTL a1 fe 00 00 00 00 01 00 GET MAX LUN 70ms 34.1.0 19:10:25.843 usbstor
29.0 1 IN 00 . 2.2ms 34.2.0 19:10:25.859
29.2 31 OUT 55 53 42 43 90 8a 2e 89 24 00 00 00 80 00 06 12 USBC....$....... 237us 35.1.0 19:10:25.859 usbstor
00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 ...$........... 35.1.16
29.1 36 IN 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 3.8ms 36.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 36.1.16
29.1 13 IN 55 53 42 53 90 8a 2e 89 00 00 00 00 00 USBS......... 116us 37.1.0 19:10:25.859 usbstor
29.2 31 OUT 55 53 42 43 90 8a 2e 89 fc 00 00 00 80 00 0a 23 USBC...........# 124us 38.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 fc 00 00 00 00 00 00 00 ............... 38.1.16
29.1 USTS c0000004 stall pid 444us 39.1.0 19:10:25.859 usbstor
29.1 RESET 17us 40.1.0 19:10:25.859 usbstor
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19sc 41.1.0 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 48us 41.2.0 19:10:45.609
29 RESET 42us 42.1.0 19:10:45.609 unknown
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 49us 43.1.0(2) 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 42us 43.2.0 19:10:45.609
24.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 91us 45.1.0 19:10:45.609 usbhub
24 0 IN 132ms 46.1.0 19:10:45.750 usbhub
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 32us 47.1.0 19:10:45.750 usbhub
24.0 4 IN 03 05 10 00 .... 45us 47.2.0 19:10:45.750
24.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 16us 48.1.0 19:10:45.750 usbhub
中间转换等待了19秒(红色)都没回应,是不是这里导致无法识别呢?
Device Length Phase Data Description Delta Cmd.Phase.Ofs(rep) Time Driver
------ -------- ----- -------------------------------------------------- ---------------- ----- ------------------ ------------ ------------
29.0 42 IN 2a 03 4d 00 61 00 72 00 76 00 65 00 6c 00 6c 00 *.M.a.r.v.e.l.l. 1.8ms 26.2.0 19:10:25.687
20 00 4d 00 61 00 73 00 73 00 20 00 53 00 74 00 .M.a.s.s. .S.t. 26.2.16
29.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 50ms 29.1.0 19:10:25.734 usbstor
29.0 18 IN 12 01 00 02 00 00 00 40 87 12 cd a6 00 00 01 02 .......@........ 2.0ms 29.2.0 19:10:25.734
00 01 .. 29.2.16
29.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 43us 30.1.0 19:10:25.734 usbstor
29.0 9 IN 09 02 20 00 01 01 00 c0 00 .. ...... 1.9ms 30.2.0 19:10:25.734
29.0 CTL 80 06 00 02 00 00 20 00 GET DESCRIPTOR 28us 31.1.0 19:10:25.734 usbstor
29.0 32 IN 09 02 20 00 01 01 00 c0 00 09 04 00 00 02 08 06 .. ............. 1.9ms 31.2.0 19:10:25.750
50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 P............... 31.2.16
29.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 31us 32.1.0 19:10:25.750 usbstor
29.0 CTL 01 0b 00 00 00 00 00 00 SET INTERFACE 36ms 33.1.0 19:10:25.781 usbstor
29.0 CTL a1 fe 00 00 00 00 01 00 GET MAX LUN 70ms 34.1.0 19:10:25.843 usbstor
29.0 1 IN 00 . 2.2ms 34.2.0 19:10:25.859
29.2 31 OUT 55 53 42 43 90 8a 2e 89 24 00 00 00 80 00 06 12 USBC....$....... 237us 35.1.0 19:10:25.859 usbstor
00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 ...$........... 35.1.16
29.1 36 IN 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 3.8ms 36.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 36.1.16
29.1 13 IN 55 53 42 53 90 8a 2e 89 00 00 00 00 00 USBS......... 116us 37.1.0 19:10:25.859 usbstor
29.2 31 OUT 55 53 42 43 90 8a 2e 89 fc 00 00 00 80 00 0a 23 USBC...........# 124us 38.1.0 19:10:25.859 usbstor
00 00 00 00 00 00 00 fc 00 00 00 00 00 00 00 ............... 38.1.16
29.1 USTS c0000004 stall pid 444us 39.1.0 19:10:25.859 usbstor
29.1 RESET 17us 40.1.0 19:10:25.859 usbstor
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19sc 41.1.0 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 48us 41.2.0 19:10:45.609
29 RESET 42us 42.1.0 19:10:45.609 unknown
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 49us 43.1.0(2) 19:10:45.609 usbhub
24.0 4 IN 03 05 00 00 .... 42us 43.2.0 19:10:45.609
24.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 91us 45.1.0 19:10:45.609 usbhub
24 0 IN 132ms 46.1.0 19:10:45.750 usbhub
24.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 32us 47.1.0 19:10:45.750 usbhub
24.0 4 IN 03 05 10 00 .... 45us 47.2.0 19:10:45.750
24.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 16us 48.1.0 19:10:45.750 usbhub
中间转换等待了19秒(红色)都没回应,是不是这里导致无法识别呢?
#7
进展怎么样了,你是一片nandflash吧,系统和boot都是放到这片nandflash吧,用了xip+binfs了吗,用了hive了吗
#8
没有什么进展,所以这几天忙别的去了,是一片nandflash,没有用xip,用了hive。
不知道是不是flash驱动还有点问题,在看usb协议……
不知道是不是flash驱动还有点问题,在看usb协议……
#9
问了好多人,才发现在PXA下没有几个能实现的,跟USB的通信都是通过activesync实现的……