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.

EDMA on DM365

Dera Sir:

I want to use EDMA to deal with MMCSD read and write operation.

However, when I set DMA size and issue a read command to SD card, I can not get the correct result.

Below is my code, please advise me where I male a mistake.

#define OPT_BIT_A_SYNC     0x0    // A-synchronized

#define OPT_BIT_TCINTEN    0x00100000  // Transfer complete interrupt enable.

#define OPT_TCC_SFT_BIT    12    // The TCC(Transfer complete code) is at the bit 12-17 of OPT.

#define EDMA_CH_MMCSD_RECEIVE       26

  OPT                                        | SRC |ACNT  | BCNT  | DST   |SRCBIDX  | DSTBIDX | LINK       | BCNTRLD | SRCC IDX | DSTCIDX | CCNT | RSV

  {OPT_MMCSD_RECEIVE  , 0       , 4          , 8           , 0        , 0                , 4                , 0xFFFF   , 0                  , 0                 , 0                , 1           , 0     } //Parameter Set

#define OPT_MMCSD_RECEIVE           OPT_BIT_A_SYNC | OPT_BIT_TCINTEN | (EDMA_CH_MMCSD_RECEIVE << OPT_TCC_SFT_BIT)

Uint8   EDMA_temp[4][8];

/* reset the FIFO  */

 MMCSD_MMCFIFOCTL |= 1;
 t_waitusec(10);

 /* Set the Transfer direction from the FIFO as receive*/
 MMCSD_MMCFIFOCTL &= 0xFFFD;

PaRAM_list[PARAMLIST_MMCSD_R1].SRC = (UINT32)(&MMC_MMCDRR);
PaRAM_list[PARAMLIST_MMCSD_R1].DST = (UINT32)EDMA_temp[0];

 EDMA365_resetPaRAM_mmcsdReceive(); //Setup Parametr set
    
  if ( MMCSD_sendCmd( 0x12000 | MMCSD_READ_SINGLE_BLOCK, 128000, 0, MMCSD_STAT0_RSPDNE ) )
      return E_FAIL;

BTW, I compile the code on CCS 3.3 and when I run the code, only first 4 bytes are correct.

Please help me.

 

Best regards,

yuenjune