Re: SDMMC driver from 4.2 working under 5.0.



Hi
I have made some progress on this, I am still sticking to the monolithic
driver, and added the following to drivers\sdmmc\driver\diskio.c

turns out that the code that I initially received removed some code from the
original example code.


The call "GetStorageID" was doing this:


memcpy(pDstOffset, &my_geom_desc.serialNum[0], str_length + 1);


should have been doing:


// ensure the buffer will hold the information...
if ((sizeof(*psid)+str_length+1) > cBytes)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
else
{
memcpy(pDstOffset, &my_geom_desc.serialNum[0], str_length + 1);
}


The sd card that was recognised in wince420 was not recognised so I had to
format it using the storage manager (weird), I now have a SD card folder
appearing in explorer. I would like to know why I must format the card for
it to be recognised and also another problem that I didn't see in wince420
was that after a suspend resume everything seems normal until I try to write
to the card, I get the following message;

MMCDISK:DoDiskIO - CF Card no longer present! and the function of copying or
deleting is not performed( get a dialog box telling me there was an error
deleting and gives an error code 20), but the unit doesn't lock up.



Regards








"TMa" <tma@xxxxxxx> wrote in message
news:g7bqr2$3r$1$8300dec7@xxxxxxxxxxxxxxxxxxx
Thank you for your help, it looks as though I will have to move to the new
driver model, I am currently using the monolithic driver that I ported
across from wince420 which should have worked, I initially thought that a
QFE may have been responsible for the disappearance of the storage folder
from explorer but it doesn't seem to be the case.

Regards




<vishal.g.shah@xxxxxxxxx> wrote in message
news:1e0c9e39-d36c-4cc9-b348-0d0f8d693dba@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi below is the registry settings i used earlier for my mmc card
driver

[HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
"Order"=dword:15
"Dll"="SDBus.dll"
"Prefix"="SDC"

"IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=
%b","{6F40791D-300E-44E4-BC38-E0E6

3CA8375C}=%b"



[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:01 ; send no more than 64 blocks of data
per bus transfer
"Profile"="MMC"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"


[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
"Order"=dword:21
"Dll"="SDHC_MyLib.dll"
"Prefix"="SDH"



hope this helps....

On Aug 5, 6:43 pm, "TMa" <t...@xxxxxxx> wrote:
1) sdmemory.dll is not being loaded, its a mystery, also I find if I have
a
cf memory card in the pcmcia socket and a sd card in the sd card then the
cf
memory card is not visble in explorer, if I remove the sd card then the
CF
card folder appears in explorer.

2) the registry setting taken from the unit are as follows;

[HKEY_LOCAL_MACHINE\Drivers\sdmmc]
"Dll" = "sdmmc.dll"
"Prefix" = "DSK"
"Order" = dword:21 ; here i have put 21 it should be greater than
order entry of your sdbus.dll
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMMC]
"Name"="SD/MMC Card"
"Folder"="SDCARD"

[HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
"Order"=dword:15
"Dll"="SDBus.dll"
"Prefix"="SDC"
"ThreadPriority"=dword:64 ; default thread priority for dispatch
thread
"RequestListDepth"=dword:30 ; pre-allocated requests
"IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=%b","{6F40791D-30­0E-44E4-BC38-E0E63CA8375C}=%b"

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory]
"Name"="SD Memory Card"
"Folder"="Storage Card"
;"PartitionDriver"="" ; removable storage cannot have
partitions

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC]
"Name"="MMC Card"
"Folder"="Storage Card"
;"PartitionDriver"="" ; removable storage cannot have
partitions

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:40 ; send no more than 64 blocks of data per
bus transfer
;"SingleBlockWrites"=dword:1 ; alternatively force the driver to use
single block access
;"IdleTimeout"=dword:7D0 ; 2000 milliseconds
;"IdlePowerState"=dword:2 ; 0 == D0, 1 == D1, etc.
;"DisablePowerManagement"="" ; if value present, then disable (remove
value to enable)

"Profile"="SDMemory"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\High_­Capacity]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:40 ; send no more than 64 blocks of data per
bus transfer
;"SingleBlockWrites"=dword:1 ; alternatively force the driver to use
single block access
;"IdleTimeout"=dword:7D0 ; 2000 milliseconds
;"IdlePowerState"=dword:2 ; 0 == D0, 1 == D1, etc.
;"DisablePowerManagement"="" ; if value present, then disable (remove
value to enable)

"Profile"="SDMemory"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:40 ; send no more than 64 blocks of data per
bus transfer
;"SingleBlockWrites"=dword:1 ; alternatively force the driver to use
single block access
;"IdleTimeout"=dword:7D0 ; milliseconds
;"IdlePowerState"=dword:2 ; 0 == D0, 1 == D1, etc.
;"DisablePowerManagement"="" ; if value present, then disable (remove
value to enable)

"Profile"="MMC"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"

<vishal.g.s...@xxxxxxxxx> wrote in message

news:76da4ce3-4a0c-4b80-b2c8-b0778b117d96@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi TMa,
DSK is the prefix we do normally use for client driver

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:40 ; send no more than 64 blocks of data
per
bus transfer
;"SingleBlockWrites"=dword:1 ; alternatively force the driver to use
single block access
;"IdleTimeout"=dword:7D0 ; milliseconds
;"IdlePowerState"=dword:2 ; 0 == D0, 1 == D1, etc.
;"DisablePowerManagement"="" ; if value present, then disable (remove
value to enable)

"Profile"="MMC"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"

are you devloping/porting the client driver ??
i still have a doubt about your the registry settings ....can you show
the regstry settings done by you ...

On Aug 5, 4:47 pm, "vishal.g.s...@xxxxxxxxx" <vishal.g.s...@xxxxxxxxx>
wrote:



Hi ,
from the logs i am able to see that your hcd driver i.e
sdmmc.dll is getting loaded before the bus driver i.e sdbus.dll
i guess this might be the problem can you try changing the load order
of sdmmc.dll see the registry settings below

HKEY_LOCAL_MACHINE\Drivers\sdmmc]
"Dll" = "sdmmc.dll"
"Prefix" = "DSK"
"Order" = dword:21 ; here i have put 21 it should be greater
than order entry of your sdbus.dll
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMMC]
"Name"="SD/MMC Card"
"Folder"="SDCARD"

also can you check in your logs if sdmemory.dll is gettting loaded or
not.

On Aug 5, 3:45 pm, "TMa" <t...@xxxxxxx> wrote:

Hi
Thank you for your response, I am currently using the sdmmc driver
that
I
had working in wince420. I have added the necessary components from
the
catalog, sdio->sd memory, storage devices (although am not using this
driver) as I thought I could do with the one working on our wince420
bsp,
the two registry keys you mentioned are present (checked this by
using
remote registry editor). The sdmmc is being loaded as shown in the
debug.

Loaded symbols for
'E:\WINCE500\PBWORKSPACES\ATLANTA_8000_ROHS\RELDIR\XSATROHS_ARMV4I_DEBUG\BT­­­DRT.DLL'
4294792985 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: >>> Loading module
misciodrv.dll at address 0x02310000-0x0231B000 (RW data at
0x01E96000-0x01E97040)
Loaded symbols for
'E:\WINCE500\PBWORKSPACES\ATLANTA_8000_ROHS\RELDIR\XSATROHS_ARMV4I_DEBUG\MI­­­SCIODRV.DLL'
4294793072 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4:
DEVICE!RegReadActivationValues
RegQueryValueEx(Drivers\BuiltIn\BATTERY\BusPrefix) returned 2
4294793075 PID:6ffb8f0a TID:fedba02 0x8febc8a0:
DEVICE!RegReadActivationValues
RegQueryValueEx(Drivers\sdmmc\BusPrefix)
returned 2
4294793129 PID:6ffb8f0a TID:fedba02 0x8febc8a0: >>> Loading module
sdmmc.dll
at address 0x01D00000-0x01D10000
Loaded symbols for
'E:\WINCE500\PBWORKSPACES\ATLANTA_8000_ROHS\RELDIR\XSATROHS_ARMV4I_DEBUG\SD­­­MMC.DLL'
4294793246 PID:6ffb8f0a TID:fedba02 0x8febc8a0:
SDMMC--DLL_PROCESS_ATTACH
4294793248 PID:6ffb8f0a TID:fedba02 0x8febc8a0: MmcDISK: DSK_Init
4294793272 PID:6ffb8f0a TID:fedba02 0x8febc8a0: Before
mmc_init_setup()
is
entered
4294793357 PID:6ffb8f0a TID:fedba02 0x8febc8a0: tr to asssign RCA
with
ID 0
4294793375 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: >>> Loading module
batterydrv.dll at address 0x02320000-0x0232C000 (RW data at
0x01E99000-0x01E99750)
Loaded symbols for
'E:\WINCE500\PBWORKSPACES\ATLANTA_8000_ROHS\RELDIR\XSATROHS_ARMV4I_DEBUG\BA­­­TTERYDRV.DLL'
4294793518 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: ***
DLL_PROCESS_ATTACH -
Current Process: 0x42, ID: 0x6ffb8f0a ***
4294793521 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: BattDrvr: Init:
invoked
w/
context 0x0802e7e8
4294793534 PID:6ffb8f0a TID:effcbd7e 0x8ffe4000: Enter GetStorageID
4294793535 PID:4ffe44ee TID:effcbd7e 0x8ffe4000: CStore
Destructor(000B9C90)

Not sure if I need or use this but its in

4294831240 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4:
DEVICE!RegReadActivationValues
RegQueryValueEx(Drivers\BuiltIn\SDBusDriver\BusPrefix) returned 2
4294831254 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: >>> Loading module
sdbus.dll at address 0x03340000-0x03371000 (RW data at
0x01F54000-0x01F54668)
Loaded symbols for
'E:\WINCE500\PBWORKSPACES\ATLANTA_8000_ROHS\RELDIR\XSATROHS_ARMV4I_DEBUG\SD­­­BUS.DLL'
4294831336 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: SDBusDriver:
PROCESS_ATTACH
4294832402 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: SDBusDriver:
+SDC_Init
4294832406 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: SDBusDriver:
Initialize:
Using request list depth of 48 entries
4294832409 PID:6ffb8f0a TID:6fcf2fbe 0x8fe6e70c: SDBusDriver:
BusRequestCompleteDispatch Work Item Starting Up
4294832410 PID:6ffb8f0a TID:6ffb8ee6 0x8ffe74e4: SDBusDriver: Bus
Driver
instance created : 0x005365D0 ! -SDC_Init

Regards

<vishal.g.s...@xxxxxxxxx> wrote in message

news:2228f871-4adc-4b54-bae0-5aefac980e3e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi ,
can you provide us some more details of what error you are getting
exactly

1) you can enable debug messages using target ->ce debug zones and
see
the logs
specially you can check wheather client driver i.e sdmemory is loaded
in the memory successfully or not

2) make sure you have added registry entry for client driver under
HKLM\drivers\sdcard\clientdrivers\mmc_class key and also for bus
driver
HKLM\drivers\built in \sdbusdriver

3) also make sure you have added the reqd os catalog components like
storage manager and storage manager control panel applet , sdmemory

On Aug 4, 2:40 pm, "TMa" <t...@xxxxxxx> wrote:

I'm tyring to get the SDMMC driver from 4.2 working under 5.0. I
see
the
card in the the storage manager applet but cannot format it, It
shows
up
as
an active driver and everything seems to be ok with the exception
of
one
thing I never see the "SDMMC Disk" folder in the file system.

Registry is as follows;

[HKEY_LOCAL_MACHINE\Drivers\sdmmc]
"Dll" = "sdmmc.dll"
"Prefix" = "DSK"
"Order" = dword:1
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMMC]
"Name"="SD/MMC Card"

...

read more »- Hide quoted text -

- Show quoted text -




.