This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP138 MMCSD 读写操作(OMAP-L138_FlashAndBootUtils_2_40 SDMMCWriter)

Other Parts Discussed in Thread: OMAP-L138

在OMAP-L138 C6000 DSP+ARM Processor Technical Reference Manual手册中的“27.3.2 MMC/SD Mode Single-Block Write Operation Using CPU”提到“13. Set the DMATRIG bit in MMCCMD to trigger the first data transfer.”,

但是在参考代码OMAP-L138 _FlashAndBootUtils_2_40中的SDMMCWriter内的写操作函数SDMMC_MEM_writeBytes中没有看到这个操作?

而且文档对于DMATRIG bit 的说明仅限于Table 27-18. MMC Command Register (MMCCMD) Field Descriptions中的:

0 Data transfer has not been triggered.
1 Data transfer is triggered.

  • 你说的是这一段代码吧:

    // Prime the FIFO with data
    status = SDMMC_writeNWords(hSDMMCInfo, (Uint32*)src, hSDMMCInfo->dataBytesPerOp);
    byteCnt -= hSDMMCInfo->dataBytesPerOp;
    src += hSDMMCInfo->dataBytesPerOp;

    // Write Data, every time MMCDXR Reg full
    if (SDMMC_MEM_CAPACITY_TYPE_HIGH == hSDMMCMemInfo->capacity)
    {
    // Issue the write command to the device
    if(numBlks == 1)
    {
    status = SDMMC_sendCmd(hSDMMCInfo, 0x2800 | SDMMC_WRITE_BLOCK, addr >> hSDMMCInfo->dataBytesPerBlkPower2, 0);
    }
    else
    {
    status = SDMMC_sendCmd(hSDMMCInfo, 0x2880 | SDMMC_WRITE_MULTIPLE_BLOCK, addr >> hSDMMCInfo->dataBytesPerBlkPower2, 0);
    }
    }
    else
    {

    if(numBlks == 1)
    {
    status = SDMMC_sendCmd(hSDMMCInfo, 0x2800 | SDMMC_WRITE_BLOCK, addr, 0);
    }
    else
    {
    status = SDMMC_sendCmd(hSDMMCInfo, 0x2880 | SDMMC_WRITE_MULTIPLE_BLOCK, addr, 0);
    }
    }