evan908
驱动牛犊
驱动牛犊
  • 注册日期2008-11-13
  • 最后登录2008-11-14
  • 粉丝2
  • 关注0
  • 积分2分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:3176回复:1

在WINCE5.0上实现通过USB device访问大容量SD卡问题

楼主#
更多 发布于:2008-11-13 18:30
在对机器上的存储媒介做mass storage的时候出现了这么个问题..
系统是WINCE5.0
芯片是S3C2443
用Serial方式时SD卡可支持到8G,并能全部映射出去在PC机上显示出来.
但是用mass storage则出现问题:
具体现象是这样的:2G以下的卡通过USB MASS STORAGE PC能正常识别.
                      2G以上的卡PC提示"无法识别的设备"
不插卡 PC提示"设备无法启动"
 
我们做了跟踪,得出的结论是SD卡驱动的问题.
但是不能确定是PB上SD卡程序问题还是BSP部分程序问题.

跟踪步骤如下:
1.插入8G卡 并连接PC.
 
 
2.CE程序运行到...../USBFN/CLASS/STORAGE/TRANSPORT/BOT/BOT.CPP文件中的函数
BOT_DeviceNotify(   )
{
.................
                case UFN_ATTACH: {
                    DEBUGCHK(!g_fStoreOpened);
                    DWORD dwRet = STORE_Init(g_szActiveKey);
                    if (dwRet != ERROR_SUCCESS) {
                        ERRORMSG(1, (_T("%s Failed to open store\r\n"),
                            pszFname));
                    }
                    else {
                        g_fStoreOpened = TRUE;
                    }
                    break;
                }
......................
}
出现打印Failed to open store 说明DWORD dwRet = STORE_Init(g_szActiveKey); 失败了
 
 
3. 继续跟踪进入STORE_Init()函数
...../USBFN/CLASS/STORAGE/EMULATION/SCSI2/BLOCK/BLOCK.CPP文件中的函数
STORE_Init()
{
.................
    // read name of store to expose
    cbData = sizeof(g_szDeviceName);
    dwError = RegQueryValueEx(hKey, PRX_DEVICE_NAME_VAL, NULL, &dwType, (PBYTE) g_szDeviceName, &cbData);
//得到SD卡的名字  "DSK1"
....................
    // open store
    g_hStore = OpenStore(g_szDeviceName);
    if ((g_hStore == NULL) || (g_hStore == INVALID_HANDLE_VALUE)) {
        dwError = GetLastError();
        DEBUGMSG(ZONE_ERROR, (_T(
            "%s failed to open store %s; error = %u\r\n"     //这里打印出 failed to open store
 

            ), pszFname, g_szDeviceName, dwError));
        goto EXIT;
    }
 
...............
}
 
这里打印出 failed to open store 说明OpenStore()函数打开错误.
也就是打开8G的SD卡操作失败了.


另外要问一下,
OpenStore()打开SD卡后
紧跟着是运行SD卡的哪部分?
high
论坛版主
论坛版主
  • 注册日期2002-08-10
  • 最后登录2010-07-26
  • 粉丝4
  • 关注0
  • 积分60分
  • 威望655点
  • 贡献值0点
  • 好评度56点
  • 原创分0分
  • 专家分60分
沙发#
发布于:2008-11-20 05:23
我没有试过, 不过, 你可以试试打下7月的补丁
-----------------------------------------------------------------------

Component:  FileSys

    *

      080701_KB954089 - This update addresses the following issues:

        *

          SD card mount failure may occur when FATFS driver checks FSInfo when mounting a store.
        *

          TFAT corruption may occur if power is turned off during the NAND flash write operation.

    The file(s) with the new source code changes for this component can be found in the directory %_WINCEROOT%\:

         private\winceos\coreos\fsd\fatfs\volume.c
游客

返回顶部