none
IMAX283的wince6.0系统升级,无法读写nandflash问题? RRS feed

  • 问题

  • 在IMAX283的平台上的wince6.0系统固件升级,在重新读写flash时,存在如下问题,查不到原因,不知道u32usec 这个值为什么是这样的?u32usec 2 is 0xd0390000 

    源码文件函数:

    BOOL DMA_Wait(UINT32 u32usec, UINT32 u32NANDDeviceNum)
    {
        INT32 i32Sema;
        UINT8 r32ChipDmaNumber = (NAND0_APBH_CH+(UINT8)u32NANDDeviceNum);

    //RETAILMSG(1, (TEXT("u32usec is %d \r\n",u32usec)));

        zNAND_Misc[u32NANDDeviceNum].uDMATimeout = u32usec;

        // We'll always poll for DMA completion.
        {
            UINT32 u32Start;

            // Microsecond read - always read at start of transaction so that if
            // ThreadX times out, that time is included in the overall timeout time.
            u32Start = zNAND_Misc[u32NANDDeviceNum].uStartDMATime;
    //RETAILMSG(1, (TEXT("-u32Start is %d us\r\n",u32Start)));

            // end of DMA chain will decrement semaphore.  Poll Semaphore for
            // DMA completion.
            do {
                i32Sema = DDKApbhDmaGetPhore(r32ChipDmaNumber);

            } while ((i32Sema!= 0) &&
                     (((HW_DIGCTL_MICROSECONDS_RD() - u32Start) & 0xffffffff) < 20000000));
    //while ((i32Sema!= 0) &&(((HW_DIGCTL_MICROSECONDS_RD() - u32Start) & 0xffffffff) < u32usec));

    //RETAILMSG(1, (TEXT("-Write Sector Wait Time is %d us\r\n",HW_DIGCTL_MICROSECONDS_RD() - u32Start)));
        }

        // if timeout return error, else return NXTCMDAR field from last DMA command
        if (i32Sema != 0)
        {
            RETAILMSG(1, (TEXT("u32Start is 0x%x \r\n",zNAND_Misc[u32NANDDeviceNum].uStartDMATime)));

            RETAILMSG(1, (TEXT("uDMATimeout is 0x%x \r\n",zNAND_Misc[u32NANDDeviceNum].uDMATimeout)));

            RETAILMSG(1, (TEXT("u32usec 1 is 0x%x \r\n",u32usec)));

            RETAILMSG(1, (TEXT("MICROSECONDS_RD 1 is 0x%x \r\n",HW_DIGCTL_MICROSECONDS_RD())));
    // abort dma by resetting channel
            DDKApbhDmaResetChan(r32ChipDmaNumber,FALSE);

            RETAILMSG(1, (TEXT("u32usec 2 is 0x%x \r\n",u32usec)));

            RETAILMSG(1, (TEXT("u32usec 3 is 0x%x \r\n",u32usec)));

            RETAILMSG(1, (TEXT("MICROSECONDS_RD 2 is 0x%x \r\n",HW_DIGCTL_MICROSECONDS_RD())));

            RETAILMSG(1, (TEXT("MICROSECONDS_RD 3 is 0x%x \r\n",HW_DIGCTL_MICROSECONDS_RD())));

            RETAILMSG(1, (TEXT("MICROSECONDS_RD 4 is 0x%x \r\n",HW_DIGCTL_MICROSECONDS_RD())));

            RETAILMSG(1, (TEXT("MICROSECONDS_RD 5 is 0x%x \r\n",HW_DIGCTL_MICROSECONDS_RD())));

            // Abort GPMI wait
            RETAILMSG(1, (TEXT("-DMA_Wait(ERROR_DDI_NAND_DMA_TIMEOUT)\r\n")));

            return FALSE;
        } else {
            return TRUE;
        }
    }

    串口打印出的错误调试信息:

    INFO: Programming NAND flash blocks 0x10a
    u32Start is 0x0 
    uDMATimeout is 0x0 
    u32usec 1 is 0x0 
    MICROSECONDS_RD 1 is 0x0 
    u32usec 2 is 0xd0390000 
    u32usec 3 is 0x0 
    MICROSECONDS_RD 2 is 0x0 
    MICROSECONDS_RD 3 is 0x0 
    MICROSECONDS_RD 4 is 0x0 
    MICROSECONDS_RD 5 is 0x0 
    -DMA_Wait(ERROR_DDI_NAND_DMA_TIMEOUT)
    ERROR: D:\WINCE600\PLATFORM\COMMON\SRC\SOC\MX28_FSL_V2_PDK1_9\MEDIA\NAND\CORE\.\cspnand.c line 606: Failed Read cs=0, sector=0x24313


    2016年7月5日 1:29

答案

全部回复

  • 在我更新微软的2014年的wince补丁包之前,这里没有问题,更新补丁包之后重新编译内核就存在这样的问题。但是更新的内核在其他平台上运行没有这样的问题。
    2016年7月5日 1:32
  • 问题已找到,是内核D:\WINCE600\PRIVATE\WINCEOS\COREOS\STORAGE\FSDMGR 路径下的内容变化,存储管理机制有所变化,导致与IMAX283早前的BSP不兼容所致。

    由于BSP不更新了,因此可以用原来这部分的内核代码机制替换更新后的,再重新测试验证问题解决。

    2016年7月8日 1:19