Re: USB mass storage



Yes, you can change function class driver programatically -I've
explained how to do this several times on this group. Find the thread
"How to switch default usb client function driver on wince 5.0 at
runtime?" from march this year for example code.

Henrik Viklund
http://www.addlogic.se

On 6 Nov, 06:46, Mark <M...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Is there a way to have a program disable activesync and enable mass storage
then later disable mass storage and then enable activesync?
I want to activesynce to a PC. but behave as a mass storage device when I
need to attach to a printer. Do you have any suggestions on how I should do
this?



"Bruce Eitman [eMVP]" wrote:
Sorry, I re-read all of the posts and see that you are trying to get USBF
Mass Storage to work.

No, you can't have it both ways the device ether identifies itself as a Mass
Storage device, or a Serial device and the PC acts accordingly. The good
news is that if you are using ActiveSync then you can still access the
storage on the device.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Bruce Eitman [eMVP]" <beitman.nos...@xxxxxxxxxxxxxxxxxxxxxx> wrote in
messagenews:eujkfUv%23HHA.748@xxxxxxxxxxxxxxxxxxxxxxx
I think that you have added the wrong USB Mass Storage. You seem to have
added the USBF mass storage, which causes your device to show up as a USB
Mass Storage device to the PC.

That is okay, but if you want ActiveSync then you need to set the default
client to be serial instead of mass storage.

[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
"DefaultClientDriver"="Serial_Class"

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Mark" <M...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4D60A82A-F2ED-4FC9-8667-7874B0C19C6E@xxxxxxxxxxxxxxxx
I do not see my NOR drive show up in the registry under
[HKEY_LOCAL_MACHINE\Drivers\Active]
by using the remote registry (I know the NOR device works as I am saving
files to it) - I did this on a version without
the mass_storage_class since when I have it included I can no longer
active
sync.
Is there a way to have both Active sync and USB mass storage?
I do see my SD Card as DSK1. It was the only thing under the
Divers\Active
to have DSK in its name.
I tried changing the registry entries as shown below. Is there something
else I need to do?

[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
"Dll"="usbmsfn.dll"
"InterfaceSubClass"=dword:06
"InterfaceProtocol"=dword:50
"DeviceName"="DSK2:"
"FriendlyName"="Mass Storage"
; idVendor must be changed. 045E belongs to Microsoft and is only to be
used
for
; prototype devices in your labs. Visithttp://www.usb.orgto 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

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NOR]
"Dll"="NorFmd.dll"
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"Ioctl"=dword:4
"MemBase"=dword:BA000000
"MemLen"=dword:5C00000
"Order"=dword:2
"Index"=dword:2
"Prefix"="DSK"
"Profile"="NOR"

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NOR]
"AutoFormat"=dword:1
"AutoMount"=dword:1
"AutoPart"=dword:1
"DefaultFileSystem"="FATFS"
"Dll"="NorFmd.dll"
"FileSystem"="fatfsd.dll"
"Folder"="Internal Storage"
"Name"="NOR Flash File System"
"Paging"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NOR\FATFS]
"CheckForFormat"=dword:1
"Flags"=dword:14
"FormatTfat"=dword:1
"MountFlags"=dword:6

[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\NOR]
"Bootphase"=dword:0
"DriverPath"="Drivers\\BuiltIn\\NOR"
"LoadFlags"=dword:1
"Order"=dword:0

"Henrik Viklund" wrote:

There are several alternatives but on a running device you can search
for the block driver's device name in the registry under
[HKEY_LOCAL_MACHINE\Drivers\Active].

It's usually a good idea to specify indexes for the block drivers to
guarrantee the same index regardless of when it is loaded.

Henrik Viklund
http://www.addlogic.se

On Sep 19, 7:34 am, Mark <M...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
How do i figure out what the index of my block device is? I do not
see a
"Index"=dword:2 for my NOR flash device.

"Henrik Viklund" wrote:
I think you have confused "Order" with "Index" in the registry
settings. You need to know the "Index" of the block device you want
to
expose. Either you figure out what index your block device is
assigned
and append that to the prefix, or you can force a specific index by
specifying "Index" in the registry. "Index"=dword:2 in the StrataFMD
registry settings should ensure it gets the device name "DSK2:".

Henrik Viklund
http://www.addlogic.se

On Mar 5, 11:56 am, Bølla <B...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Thanks for reply! I was not able to open your link or find the
document you
referred to Sameer. I have tried using the PB help, but without
success. So
if someone has a good guidline in how get a device (USB Functional
Client)
look like a flash disk when connected to the PC (host side) , it
is
appreciated.

My starting point was to copy the
WINCE500\PUBLIC\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD to my work
catalog and
and do some modifications. Next I have attached my resulting log
file
generated during boot and the reginit.ini file (only parts that
has to do
with this problem).
1) Does this look OK or is there something I have left out?

As I understands your reply:
2) It is the identity "DSK2:" that connects USB driver with the
flash driver?

Looking forward for reply!
/trond

This is the debug log:
-------------------------
0x83c52000: UsbFnMdd!UFN_Init: PDD has 16 endpoints
0x83c52000: UsbFnMdd!UFN_Init: PDD supports speeds 0x1
0x83c52000: UsbFnMdd!CUfnBus::CreateChild: Using client driver key
"\Drivers\USB
\FunctionDrivers\Mass_Storage_Class"
0x83c52000: DEVICE!RegReadActivationValues
RegQueryValueEx(\Drivers\USB\Function
Drivers\Mass_Storage_Class\Prefix) returned 2
0x83c52000: DEVICE!RegReadActivationValues
RegQueryValueEx(\Drivers\USB\Function
Drivers\Mass_Storage_Class\BusPrefix) returned 2
0x83c52000: UsbMsFn!DllEntry: Attached
0x83c52000: UsbFnMdd!UfnMdd_RegisterDevice: Device registered
0x83c52000: UsbMsFn!BOT_InternalInit: BOT transfer thread priority
= 100
0x83c52000: UsbFnMdd!CPipe::Open: Opened pipe (0x002b9000):
physical address
0,
bus address 0x00
0x83c52000: UsbFnMdd!UfnMdd_Start: Function controller running
0x83a794a8: UsbMsFn!STORE_Init: DeviceName = DSK2:
0x83a794a8: UsbMsFn!STORE_Init: Removable = 0
0x83a794a8: UsbMsFn!STORE_Init: failed to open store DSK2:; error
= 4319
0x83a794a8: ERROR:
c:\macallan\public\common\oak\drivers\usbfn\class\storage\tra
nsport\bot\bot.cpp line 907: 0x83a794a8: UsbMsFn!BOT_DeviceNotify:
Failed to
ope
n store
0x83c52000: UsbFnMdd!CUfnBus::ActivateChild: Activated client
driver
"Mass_Stora
ge_Class"
0x83c52000: DEVICE!RegReadActivationValues
RegQueryValueEx(Drivers\BuiltIn\Seria
l2\BusPrefix) returned 2

This is from my debug reginit.ini:
--------------------------------------
; @CESYSGEN IF CE_MODULES_USBMSFN
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
"DefaultClientDriver"=- ; erase previous default
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
"DefaultClientDriver"="Mass_Storage_Class"

[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
"Dll"="usbmsfn.dll"
"InterfaceSubClass"=dword:06
"InterfaceProtocol"=dword:50
"DeviceName"="DSK2:"
"FriendlyName"="Mass Storage"
; idVendor must be changed. 045E belongs to Microsoft and is only
to be used
for
; prototype devices in your labs. Visithttp://www.usb.orgtoobtain
a
vendor id.
"idVendor"=dword:045E
"Manufacturer"="Generic Manufacturer (PROTOTYPE--Remember to
change
idVendor)"
"idProduct"=dword:0001
"Product"="Generic Mass Storage (PROTOTYPE--Remember to change
idVendor)"
"bcdDevice"=dword:0
"Removable"=dword:0
; @CESYSGEN ENDIF CE_MODULES_USBMSFN

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\StrataFMD]
"Dll"="stratad.dll"
"Order"=dword:2
"Prefix"="DSK"
"Ioctl"=dword:4
"Profile"="MSFlash"

...

läs mer »- Dölj citerad text -

- Visa citerad text -


.



Relevant Pages

  • Re: Need Help: CE5.0 flash is not shown as USB mass storage device
    ... Even though i made the usb mass storage function ... driver usbmsfn.dll as the default client driver, ... USB active sync works fine without any problem. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: ROM-only FS and persisting registry on USB HD
    ... driver and step into the code to figure out how it failed. ... PCI bus driver and its relative registry setting should be moved into BOOT ... you have to have your USB host controller's driver ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Need Help: CE5.0 flash is not shown as USB mass storage device
    ... Bruce.Eitman AT EuroTech DOT com ... driver usbmsfn.dll as the default client driver, ... only usb serial function driver is getting loaded. ... I am trying to expose my flash folders as a USB mass storage ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Drivers Update? QFX?
    ... Is it any way to use USB Mass Storage function under ... I want to connect my device to PC host ... function driver + USB Function POD Transport driver + ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB flash disk
    ... I am developing Host controller driver for OTG controller. ... The USB bus enumeration is ... Am I missing something in the Registry? ... for large USB disk keys) ...
    (microsoft.public.windowsce.platbuilder)