Hai,
I am studying about the SDIO Card driver. From my understanding the client driver is loaded after inseting the SD Card by the Bus driver.
When the Host controller Driver is loaded
Actually i want to diagnosis the SD Card port before inserting the SD Card .Is there any means to find this.I am using the PXA270 processor

About SDIO Card Driver
NickNotYet
You'd better get yourself a copy of Platform Builder if you are really set on doing this. Talking to the hardware is no small task and it is platform dependant so you will have to rewrite it for several platforms, essentially writing your own PDD layer. If you are just trying to see if an SDIO port is available there a ways of checking the registry. You can also (as Micheal suggested) just interface to the devices.exe to see if it's available. However if interfacing directly to the hardware is really your desire then you are in the wrong newsgroup. Try going to a newsgroup that does Platform Builder as most of the people here are native developers not platform developers.
Try:
http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.windowsce.platbuilder&lang=en&cr=US
or
http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.windowsce.embedded&lang=en&cr=US
Zadoras
You should ask the manufacturers of the driver. Each client driver is different and it needs to be set up properly for the device. If the device is not loading at runtime then it could be a problem with the client drivers registries, a problem with the driver, or a problem with the device.
Only the client driver should have access to SDCardInfoQuery. This is probably why the command did not work.
DQM
Hai ,
can anyone send a sample application to test SDIO Card communication in WINCE.
Thanks in advance
Ross B.
Hai,
Here is the sample application.see whether i did any mistake
HANDLE hSdcDev;
hSdcDev = RegisterDevice( TEXT("DSK"), 1, TEXT("SDMemory.dll"),0);
if(hSdcDev == INVALID_HANDLE_VALUE)
{
printf("not able register device.: %d", GetLastError());
}
HANDLE Handle;
printf("get the handle\n");
Handle = CreateFile(L"DSK1:",GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL );
if(Handle == INVALID_HANDLE_VALUE)
{
printf("not able get the handle.: %d", GetLastError());
}
SD_API_STATUS status;
SD_PARSED_REGISTER_CID stcid = {0};
SD_PARSED_REGISTER_CID *pRedCID = NULL;
status = SDCardInfoQuery(Handle,
SD_INFO_REGISTER_CID,
pRedCID,
sizeof(SD_PARSED_REGISTER_CID));
if (!SD_API_SUCCESS(status))
{
printf("not able get the card info.: %d", GetLastError());
}
else
{
printf("CID information\n");
printf("Manufacturer id :%c\n",stcid.ManufacturerID);
printf("Manufacturing month %c\n", stcid.ManufacturingMonth );
}
if (Handle!=NULL)
{
CloseHandle(Handle);
}
if (hSdcDev!=NULL)
{
DeregisterDevice(hSdcDev);
}
But i saw the client drivers in the path HKLM\Drivers\SDCARD\ClientDrivers\Class..But i didnt find these in the HKLM\Drivers\Active registry after inserting the card.
MMC_Class
SDIO_Class
SDMemory_Class
In the code when using the CreateFile i am getting Invalid Handle( error 55 ERROR_DEV_NOT_EXIST) .Whether i need to add anything in the code..pls check this ..Is there any means to debug this problem.
Remmie
Hi
Yes, thats right.
The SD Host Controller driver itself gets loaded by the device manager (device.exe) on OS boot time.
Read more here: http://msdn.microsoft.com/library/default.asp url=/library/en-us/wceddk5/html/wce50condriverloadingprocess.asp
The main tool to debug a driver is the kernel debugger shipped in Platform Builder. Details on how to use those tools can be found here: http://msdn.microsoft.com/library/default.asp url=/library/en-us/wcedebug5/html/wce50conplatformdebugging.asp
ZopoStyle
johnnyXNA
Hai,
I am using
processor - PXA270
OS - WINCE
SDCARD - NCP
calvin_mayo
Hai,
Thanku for ur reply.Actually i want to write an application to test the hardware(the SDIO interface of the PXA270) before inserting the SDIO Card. Means i want to perform Hardware diagnosis before inserting the card.. After checking the SD interface if it is fine then user can insert the SD Card..Can we do this without checking insertion or removal of the card(Before the client driver is loaded..Because the Bus and Host controller drivers will be loaded at the OS boot time itself)
.Is there any means to find this ..so that we can tell that SDIO interface is working fine in the Diagnosis phase of the system.
Thanks in advance
sun919
Hai,
Thank u for ur immediate reply.
WINCE image is loaded into PXA270 .Are there any commands in WINCE SD Card driver to find the SD Card port (slot)status of PXA270 before loading the client driver i.e., before placing the SD Card. when is the status code SD_API_STATUS_DEVICE_NOT_CONNECTED will come. can we write an application to diagnosis the SD Card port of PXA270
codekaizen
It's not the direct handle that you need but the handle that is given t the client driver upon initialization. It's a unique identifier to let the bus driver know which client driver it's talking to. You shouldn't have access to this handle unless you built the client driver which you didn't. So unless the people who built the client driver did some funky design you can not make that call.
Honestly, I am not making this stuff up. I've built an SDIO client driver. I know what I'm talking about. You can't make that call.
Sergey424701
As I have already mentioned to you you need the handle of the bus driver to make the SDCardInfoQuery call. The handle you have retreived is the client driver. You will not have access to the bus driver handle and therefore you can't make that call.
Aelx
//INSERTION/REMOVAL EVENTS
#define WM_SD_INSERTION 0x8000#define WM_SD_REMOVAL 0x8004
Check these against the WPARAM value for insertion and removal of the card.
You can look in dbt.h for more info.
gokce
Hai,
I wrote a sample application to interact with SD Card.I want to use the existing the Client drivers in WINCE.When executing the application i used SDCardInfoQuery API function.There i am getting exception saying 0XC0000005 :access violation.
The bus driver and host controller drivers are there in the active registry.But i didnt find any client driver in the active registry.What is the reason behind that..can any one guide me ...what mistake i have done
ChecMate
Hai,
If i am using the handle of the bus driver (SDC1:) then after the function SDCardInfoQuery I am getting the following exception
first chance exception in the exe : 0xc0000005: Access violation.