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.

How to use EDMA service McAsp in omap-l137

I need some help to solve the following two problems:

1. I can receive data from McAsp through peripherial port by CPU polling mode,  but I can't read anything through DMA port(RBUSEL=0), why?

2.I can't use EDMA to service McAsp, the configuration is as below:

EDMA3PaRAM2_OPT=0x00000201;   //1D-1D Transfer with A-syncronization
 EDMA3PaRAM2_SRC=0x01D01BA0;   //source address:MCASP1_RBUF1
 EDMA3PaRAM2_A_B_CNT=0x00400024;  //BCNT=40;ACNT=36
 EDMA3PaRAM2_DST=0x11800000;   //destination:DSP L2RAM
 EDMA3PaRAM2_SRC_DST_BIDX=0x00240000;
 EDMA3PaRAM2_LINK_BCNTRLD=0x0024FFFF;
 EDMA3PaRAM2_SRC_DST_CIDX=0x00000000;
 EDMA3PaRAM2_CCNT=0x00000003;  //CCNT=3

/*EDMA3PaRAM2 configuration complete*/

 EDMA3CC_EESR=0x00000004; //enable EDMA_EVENT_2(start EDMA)

could someone tell me why? I really need your help, thank you

  • I apologize for the unclear documentation.  I've submitted a request internally to clarify on this point.  When using RBUSEL=0 you need to use a different address to access the "DMA port".  The address is what we call "McASP 1 Data" in the Memory Map section of the data sheet.  I've attached a screenshot of what I'm talking about below.  Try using 0x01D06000 as your source address.

  • daisy wu said:

    EDMA3PaRAM2_OPT=0x00000201;   //1D-1D Transfer with A-syncronization

    Another very big source of confusion in our documentation is the use of the term FIFO in the EDMA OPT fields. There are actually very few cases where you would ever want to use SAM or DAM = 1. Instead, please change your OPT to all 0's. Even though you will be using "INCR" mode for both SAM and DAM, by setting your IDX value to 0 for both SRC IDX fields you will get a fixed address for your source. The CONST mode is for special internal bus controls, and I cannot name a device that uses this although I have heard that there may be one. The McASP is not one of them.

    It will be helpful to set TCINTEN so you will get an interrupt indication when the transfer has completed. This can just be in IPR within the EDMA so you can poll for the completion or even observe it in CCS. Otherwise, you will only know the transfer is complete by looking at the received data and noting that the PARAM has been cleared to all 0's by the LINK=NULL setting.

    To set TCINTEN, use OPT=0x00100000 to arbitrarily set IPR bit 0, or OPT=0x00102000 to set IPR bit 2 to match the event number for McASP1.

    daisy wu said:

     EDMA3PaRAM2_A_B_CNT=0x00400024;  //BCNT=40;ACNT=36

    You are mixing hex and decimal values between your data value and your comments, please double-check for your intended values. When each receive event occurs, if there are nine (9) serializers with receive data ready to be read, then your ACNT value is correct, being 9*4=36. BCNT*CCNT will be the number of sample times you want to capture. If the data should all be stored sequentially, then you can use BCNT=#sample sets and CCNT=1. If groups of samples need to be placed on top of each other or in widely spaced buffers, then BCNT=#samples per group and CCNT=#groups.

    daisy wu said:

     EDMA3PaRAM2_DST=0x11800000;   //destination:DSP L2RAM

    It is safer to use a buffer location for your memory addresses, like Audio_Buffer. If your program is loaded into L2, there may be conflict with this destination location. And you also need to make sure you use the "global" address range of 0x1180xxxx like you have here. If your program is linked into the "local" address range at 0x00800000, then the EDMA cannot use that address but you will still get overwritten if 0x11800000 is used for the destination. My recommendation is to always use only the "global" address range for everything in your program rather than ever using 0x00800000.

    daisy wu said:

     EDMA3PaRAM2_LINK_BCNTRLD=0x0024FFFF;

    BCNTRLD should be the same as BCNT. There are fancy exceptions to this, but you most likely want to copy the same number of samples per group for each group.

    daisy wu said:

     EDMA3PaRAM2_SRC_DST_CIDX=0x00000000;
     EDMA3PaRAM2_CCNT=0x00000003;  //CCNT=3

    Since you are using CCNT>1, you need to have a value for DSTCIDX instead of 0. The most likely value will be the same as DSTBIDX = ACNT if you want all the samples to continue to fill a large buffer. If you want each of the three CCNT groups of samples to overwrite the previous ones, then you would use DSTCIDX=(1-ACNT)*BCNT to move the DST address back to the start of the DST buffer. Be sure to still keep SRCCIDX=0.

  • Do you use the same address for both transmit and receive?  I've been trying to get McASP/DMA working without driver overhead and have been running into similar problems as Daisy.

    Thanks,

    Chris

  • Yes, that same address range can be used for receive or transmit.  The hardware is able to route data to/from the receiver or transmitter based on whether you're doing a read or write from that address.