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.

请教关于5509A读取SD卡的问题



在看TMS320VC5509 DSP MultiMediaCard / SD Card Controller Reference Guide这个文档时,在

Figure 2−2. Single-Block Read Operation (MMC Protocol)这个操作中,

2) Check the BSYDNE bit of MMCST0 or the BUSY bit of MMCST1 to
determine whether the card is busy. If the card is busy, wait. Otherwise,
read the response from MMCCIDX and MMCRSP7−MMCRSP5. The
response should indicate that the card is in its transfer (tran) state.

这些回复状态,对我下一步操作有影响吗(我下一步操作需要用到这些response吗)?

我现在想做的是更改CSL提供的读写SD卡程序retVal = MMC_read(mmc0,addr,datareceive,512);(因为要使能DMA搬运数据)

将其改变为发送命令并对其操作的语句,发送命令的语句想直接借用CSL里面的语句

void MMC_sendCmd(
MMC_Handle mmc,
Uint16 cmd,
Uint16 argh,
Uint16 argh,
Uint16 waitForRsp,
);

  • 可以参考下面的block读写例程。
    http://www.ti.com/dsp/docs/litabsmultiplefilelist.tsp?sectionId=3&tabId=409&literatureNumber=spra808a&docCategoryId=1&familyId=325&keyMatch=spra808a&tisearch=Search-EN-Everything

     

  • 感谢您的回复

    这个文档我看过,他关于SD卡的读数据程序是运用CSL库编写的,write(read)程序只用了一句话就表示了temp = MMC_write(mmc0,0,dataptr,512);

    我现在对SD卡使能了DMA,对SD卡的数据需要用DMA来搬运MMC_ADDR(MMCDRR1)的数据,所以需要将读取相应地址的数据转化成命令格式

    因为我借鉴的是CSL的MCBSP+DMA例程,他启动DMA后再启动了mcbsp,我现在想将其改成设置SD卡块长度后,发送READ_SINGLE_BLOCK命令

        /* Enable DMA */
        DMA_start(hDmaRcv);
        DMA_start(hDmaXmt);
        /* Take MCBSP transmit and receive out of reset */
        MCBSP_start(hMcbsp,
                    MCBSP_XMIT_START | MCBSP_RCV_START,
                    0u);
  • 我使用CSL提供的函数MMC_sendCmd,问题已解决,感谢您的回答