Hello!
I am trying to use the usb function driver with the mass storage class
and am losing my RAMDISK folder on my device once I attach the USB
cable and the UsbMsFn STORE_Init function is called.
Here is the debug from after I attach my USB cable to the host and the
STORE_Init() function is called:
344138 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
DeviceName = DSK1:
344143 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
Removable = 1
344146 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
IOCTL_DISK_GETINFO passed
344146 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
bytes per sector = 512
344146 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
cylinders = 0
344147 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
flags = 0xa
344147 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
heads = 0
344147 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
sectors = 2
344147 PID:c3e49bae TID:e3c7bd92 0x83c747f0: UsbMsFn!STORE_Init:
total sectors = 64
344151 PID:3ec4432 TID:e3c7bd92 0x83c747f0:
FSD_UnmountDisk(0x1c6700): unmounting...
344151 PID:3ec4432 TID:e3c7bd92 0x83c747f0: FATFS!UnmountDisk:
unmounting all volumes on disk 001C6700
344155 PID:3ec4432 TID:e3c7bd92 0x83c747f0: <<< Unloading module
diskcache.dll at address 0x03E80000-0x03E89000 (RW data at
0x01FF2000-0x01FF24F4)
Unloaded symbols for 'D:\WINCE500\PBWORKSPACES\VESTA\RELDIR
\KSO_ARMV4I_DEBUG\DISKCACHE.DLL'
344157 PID:3ec4432 TID:e3c7bd92 0x83c747f0: FATFS!FATDetach complete
(0 sectors written in 0 requests)
344158 PID:3ec4432 TID:e3c7bd92 0x83c747f0: <<< Unloading module
fatfsd.dll at address 0x03E90000-0x03EBB000 (RW data at
0x01FF4000-0x01FF463C)
Unloaded symbols for 'D:\WINCE500\PBWORKSPACES\VESTA\RELDIR
\KSO_ARMV4I_DEBUG\FATFSD.DLL'
As I said, I am using RAMDISK and already have my DSK1: device with
the "Storage Card" folder available on my device. The STORE_Init()
function calls OpenStore() and then an IOCTL to GETINFO and then a
DismountStore() function call. Does anyone know why this function
would want to dismount the store? The STORE_Close() function also
calls for the dismount, but that makes sense. Once the
DismountStore() function is called, my "Storage Card" folder goes
away. Can anyone explain this to me? Is this a bug with that
sample? Or am I just doing something wrong?
I am using the Microsoft provided
\\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\STORAGE
implementation and the STORE_Init() function in \STORAGE\EMULATION
\SCSI2\BLOCK\block.cpp and basing my function driver on the mainstone
II implementation.
I still have not seen my host PC acknowledge my device regardless of
whether I allow the dismount to be called or not and will try a USB
analyzer next to look at what is going on there.
Any help would be greatly appreciated!!
Thanks,
Vanessa