zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
阅读:3326回复:16

SD卡初始化完加载不上SDmemory.dll

楼主#
更多 发布于:2007-05-19 20:31
各位大虾帮忙看看,谢谢了。
下面是错误信息:
0x8ce73100: SDBusDriver: Device Ready, loading driver...
0x8ce73100: DEVICE!RegReadActivationValues RegQueryValueEx(\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\BusPrefix) returned 2
0x8ce73100: SDMemory: +SMC_Init
0x8ce73100: SDGetDeviceHandle: ActivePath: Drivers\Active\4294967290
0x8ce73100: SDGetClientFunctions: +Init
0x8ce73100: SDGetClientFunctions: -Init
0x8ce73100: SDMemCalcDataAccessClocks: Tpd:f ns, Asynch: f ns, AsyncClocks:0 , SyncClocks: 1078198272, ReadTotal: 0, Write Factor: 1094116192 WriteTotal: 37500
0x8ce73100: SDMemCardConfig: Card indicates unsupported file system (non FAT)
0x8ce73100: SDMemory: Error initialising MemCard structure and card
0x8ce73100: DEVICE!LaunchDevice: Init() failed for device 0x0004c780
0x8ce73100: DEVICE!I_ActivateDeviceEx: couldn't activate: prefix DSK, index 1, dll SDMemory.dll, context 0x622f3c4
0x8ce73100: SDBusDriver: Failed to load driver with path: \Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class
0x8ce73100: SDBusDriver: HandleAddDevice has been complete!

谢谢了,
做一个出色的程序员!
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-07-03 09:41
兄弟,问题解决了没?我出现了与你一模一样的问题 。
顶上
http://www.esdevelop.cn
winceprovide
驱动牛犊
驱动牛犊
  • 注册日期2007-07-01
  • 最后登录2008-02-18
  • 粉丝0
  • 关注0
  • 积分80分
  • 威望9点
  • 贡献值0点
  • 好评度8点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-07-03 09:53
SDMemCardConfig: Card indicates unsupported file system (non FAT)
格式化为FAT试一试
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-07-03 10:21
FAT,FAT32都试过不了。没用。
LoadSDdriver时调用DefaultBusDriver::ActivateChild(pszChildBusName)返回失败了。但就是找不到DefaultBusDriver::ActivateChild的定义。
http://www.esdevelop.cn
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2007-07-03 14:55
已经解决了,驱动已经做完了,呵呵
先更新一下,五月份的WinCE的更新。
里面几乎全是SD卡的,更新之后重新试试。呵呵。
再这把catalog----------->storage manage给加上,
在控制面板里面,storage manage里面看看能不能看见SD卡。
问题比较久了,当时忘了怎么解决的。
你先试试这个看看,有问题再讨论,
做一个出色的程序员!
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2007-07-03 15:27
不好意思,上面的回答不对,看错了问题。
个人感觉问题可能是:
在Busrequest函数中,你对Sendcommand之后,
然后对相应的命令收回应,
需要将这些回应提交给Sdmemory.
你在添response的时候出了问题。
你可以自己跟一跟,看你提交的CSD是否正确??
估计是这个问题。。呵呵。。
做一个出色的程序员!
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2007-07-06 18:19
是在GetCommandResponse中出了问题吗?
但是都没有报错的啊。
BusRequestHandler starts (CMD:2)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0002, 0x00000000, 0x0003, 0x0) starts
sendSDICommand long response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:3)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0003, 0x00000000, 0x0007, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:9)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0009, 0x00020000, 0x0003, 0x0) starts
sendSDICommand long response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:13)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x000d, 0x00020000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:7)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0007, 0x00020000, 0x0002, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:55)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0037, 0x00020000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:51)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0033, 0x00000000, 0x0001, 0x1) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:55)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0037, 0x00020000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:42)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x002a, 0x00000000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
SDHCDSlotOptionHandler option=SDHCDGetWriteProtectStatus
SDHCDSlotOptionHandler ends
BusRequestHandler starts (CMD:55)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0037, 0x00020000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
BusRequestHandler starts (CMD:6)
SDHCD: Clock started...
SendCommand (0x0004f100, 0x0006, 0x00000000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
http://www.esdevelop.cn
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2007-07-07 17:43
zhuxiaofeng :
另外:
CSD的值不是直接从SD卡的寄存器里面读出来的吗?
http://www.esdevelop.cn
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2007-07-07 18:07
是呀,CSD是靠CMD9这个命令读出来的。

cmd2--cmd3---cmd51--cmd9等命令的发送
是在sdhceventhandles.cpp中的HandleAddDevice()这个函数实现的,
加载Sdmemory也在这里面,
在里面debug一下,看提交给sdmemory.dll的response是否正确 。
具体的response意义可以参考sdcard得spec.

这个函数位于:
WinCE500\public\common\oak\drivers\sdcard\sdbusdriver下面。
做一个出色的程序员!
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2007-07-07 18:13
看你的Debug信息:是命令都执行了,
不过信息不够,我也无法判断,
在CMD6之后的命令那??
把后续的Debug信息都给贴上。。
“SDHCD: Clock started...“
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
把这个Debug信息给去了吧。。
影响看Debug信息,呵呵。。
做一个出色的程序员!
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
10楼#
发布于:2007-07-09 10:09
首先多谢zhuxiaofeng的回帖。
这个是我CSD寄存器response的结构。你看一下有什么不妥的???最后一个字符串打印出来总是乱码不知道怎么回事。
UCHAR CSDVersion=0;               // 4 bit CSD version
 struct {
     DOUBLE TAAC=0;                // The TAAC field in units of nano-seconds
     USHORT NSAC=1;                // The NSAC field in units of clock-cycle
 } DataAccessTime;
 ULONG MaxDataTransferRate=25000;      // In units of kbit/s
 USHORT CardCommandClasses=1525;      // 12 bit command class support indicators
 USHORT MaxReadBlockLength=512;      // In units of bytes
 BOOLEAN ReadBlockPartia=1l;       // Partial Block Read allowed ?
 BOOLEAN WriteBlockMisalign=0;     // Misaligned Block Writes allowed ?
 BOOLEAN ReadBlockMisalign=0;      // Misaligned Block Reads allowed ?
 BOOLEAN DSRImplemented=0;         // DSR Register implemented ?
 ULONG DeviceSize=504365056;               // Calculated device memory size in bytes
 USHORT VDDReadCurrentMin=60;       // in units of milliamps
 USHORT VDDReadCurrentMax=80;       // in units of milliamps
 USHORT VDDWriteCurrentMin=60;      // in units of milliamps
 USHORT VDDWriteCurrentMax=80;      // in units of milliamps
 BOOLEAN EraseBlockEnable=1;       // Erase in multiples of MaxWriteBlockLength ?
 UCHAR EraseSectorSize=64;          // Size of an erase sector in blocks (SECTOR_SIZE+1)
 UCHAR WPGroupSize=128;              // Size of a WP group in erase sectors (WP_GRP_SIZE+1)
 UCHAR WPGroupEnable=1;            // Group Write Protection possible ?
 UCHAR WriteSpeedFactor=128;         // Block Write time as multiple of Read access time
 USHORT MaxWriteBlockLength=512;     // In units of bytes
 BOOLEAN WriteBlockPartial=0;      // Partial block writes allowed ?
 BOOLEAN CopyFlag=0;               // Copy control flag
 BOOLEAN PermanentWP=0;            // Permanent Write Protect flag
 BOOLEAN TemporaryWP=0;            // Temporary Write Protect flag
 SD_FS_TYPE FileSystem=0;          // File System type
 UCHAR RawCSDRegister[16]=?@
http://www.esdevelop.cn
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
11楼#
发布于:2007-07-09 10:16
麻烦zhuxiaofeng再给看一下。
出错是在HandleAddDevice函数中SDLoadDevice,然后到ActivateChild失败了。最后跟踪到
if (DefaultBusDriver::ActivateChild(pszChildBusName)) {
                    status = SD_API_STATUS_SUCCESS;
                    *ppDeviceFolder = pNewChildFolder;
                    pNewChildFolder->AddRef(); // Add a reference
                }
                else {
            RETAILMSG(1,  (TEXT("CSdBusEnum.ActivateChild5 .status = %x,GetLastError()=%d\r\n"),status,GetLastError()));        
                    BOOL fSuccess = RemoveChildByFolder(pNewChildFolder);
                    DEBUGCHK(fSuccess);

DefaultBusDriver::ActivateChild返回FALES了。。

以下是我CMD6之后的打印信息。
+++ SDCard: Calling Send Handler for HC:SDH. Slot:0, Request:0x00047628
BusRequestHandler starts (CMD:6)
SDHCD: Clock started...
SendCommand (0x0004f1a0, 0x0006, 0x00000000, 0x0001, 0x0) starts
sendSDICommand short response required
GetCommandResponse started
GetCommandResponse returned SD_API_STATUS_SUCCESS
SDHCD: Clock stopped  2
SDHCD: Clock stopped...
SDHCD:BusRequestHandler ends
flyfffffffffffffffffffffffffffffffffff.status=1
SDCard: SDBusRequest-======================
powerUpFinish!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!6
BUS Width 4Bit
SDHCD:SetClockRate() - Clock rate set to 16666666 Hz
Real clock rate = 3
SDHCDSlotOptionHandler ends
SDBusDriver: Device Ready, loading driver...****************************************
SDBusDriver: Device Ready, loading driver...****************************************try to load devices
SDLoadDevice()================
SDBusDriver: Loading Driver : SDMemory.dll
SDMEMORY:: PROCESS_ATTACH!!!
m_sdBusEnum.ActivateChild1 .status = 0,loadPath= \Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class,
CSdBusEnum.ActivateChild4 .status = c0000003,pszChildBusName=\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class
CSdBusEnum.ActivateChild5 .status = c0000003,bRt=0
m_sdBusEnum.ActivateChild2 .status = c0000003
m_sdBusEnum.ActivateChild2 .loadPath = \Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class,dwHCNumber=0,SlotIndex=0,
SDMEMORY:: PROCESS_DETACH!!!
SDBusDriver: Failed to load driver with path: \Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class
SDBusDriver: HandleAddDevice-
http://www.esdevelop.cn
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
12楼#
发布于:2007-07-09 11:13
好像你没有在OS里面添加sdmemory这个组件。
catalog---->Device Driver----->SDIO--------->Sdmeomry----〉add to os design..
别的貌似没什么错误。
你check一下,添加了没有??
做一个出色的程序员!
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
13楼#
发布于:2007-07-09 11:23
这个是有加的。不然
SDMEMORY:: PROCESS_ATTACH!!!
这一句就是从sdmemory.dll里面打印出来的。
http://www.esdevelop.cn
zhuxiaofeng
驱动小牛
驱动小牛
  • 注册日期2007-04-06
  • 最后登录2010-04-15
  • 粉丝0
  • 关注0
  • 积分1013分
  • 威望243点
  • 贡献值0点
  • 好评度202点
  • 原创分0分
  • 专家分0分
14楼#
发布于:2007-07-12 11:34
出错是在HandleAddDevice函数中SDLoadDevice,然后到ActivateChild失败了。最后跟踪到
if (DefaultBusDriver::ActivateChild(pszChildBusName)) {
                    status = SD_API_STATUS_SUCCESS;
                    *ppDeviceFolder = pNewChildFolder;
                    pNewChildFolder->AddRef(); // Add a reference
                }
                else {
            RETAILMSG(1,  (TEXT("CSdBusEnum.ActivateChild5 .status = %x,GetLastError()=%d\r\n"),status,GetLastError()));        
                    BOOL fSuccess = RemoveChildByFolder(pNewChildFolder);
                    DEBUGCHK(fSuccess);

DefaultBusDriver::ActivateChild返回FALES了。。

兄弟,你这个是怎么解决的??
我现在Realse的时候会出现这个问题??
而Debug的时候没有问题。。
做一个出色的程序员!
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
15楼#
发布于:2007-07-17 10:55
在初始化里面有一断被我注释掉了。用三星提供的就不会了。呵呵。自作聪明了。
http://www.esdevelop.cn
dalee_xd
驱动牛犊
驱动牛犊
  • 注册日期2005-12-16
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望7点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
16楼#
发布于:2007-11-07 19:00
楼上的兄弟,能不能再讲具体一点:

哪个地方的初始化被你注掉了?用三星提供的什么代码就不会了?

我也碰到和你一样的问题,就是跑到ActivateChild返回失败,你是怎么解决这个问题的,请具体谈一下,谢谢~!!!
游客

返回顶部