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.

DSKC5510, transfer data from DARAM to EMIF (SDRAM) via DMA

Other Parts Discussed in Thread: CCSTUDIO

Dear all,

I have been trying to use DMA to transfer data from DARAM to SDRAM on DSKC5510 for couple of days. It doesn't work. I have tried two ways to configure DMA: by DSP/BIOS and by calling CSL  in C code. For the second way, I got the code by modifying the given DMA1 example. The weird thing is that when I tried to transfer data from EMIF to DARAM, or from DARAM to DARAM, it works. However, if the data is from DARAM to EMIF, it failed.

I am really confused about it. Could you guys help me to solve this problem?

Thanks a lot!!!

Simon

 

By the way, I did the checking by:

/* Wait for Block status bit in DMA status register to signal */
    /* transfer is complete.                                      */
    while (!(check & 0x0020)) {
        check = DMA_RGETH(myhDma, DMACSR) ;  
    }

    /* Check data values to make sure transfer happened correctly */
    for (i = 0; i <= (N - 1); i++) {
        if (dst[i] != src[i]) {
            ++err;
        }
    }

Could this be the reason?

  • Hi,

    Have you set EMIF correctly before you use DMA? My suspicion is EMIF not set right in writing timing to SDRAM.

    You can check it by memory read/write through CCS to see whether your SDRAM access working or not. After confirming you can access SDRAM by CPU then you can proceed to use DMA to SDRAM.

    Regards,

    Hyun

  • Hi Hyun,

    Thanks for the quick reply.

    I checked SDRAM as you suggested. Read/write by CPU works. When I was monitoring the variable with Watch window in CCS, the address shows it is in the SDRAM address range.

    Today, I also tried to transfer data from DARAM to SARAM, it didn't work either.

    The only thing I can think of is that SARAM and SDRAM they all have address larger than 16 bits, which means I have to shift and write the upper 16 bits to DMACSSAU (or DMACDSAU). I did so, and checked the values. They look fine.

    BTW: I used the default DSP/BIOS EMIF setup for DSKC5510 which is shown as follows. Does it look Okay to you?

    Anyway. Thank you very much for your help.

    Simon

     

     

  • Hi,

     

    Your EMIF setup looks good.

    Have you set DMACSDP register DST field and SRC field accordingly based on your source and destination memory?

    Source option:

    DMA_DMACSDP_SRC_SARAM

    DMA_DMACSDP_SRC_DARAM

    DMA_DMACSDP_SRC_EMIF

    DMA_DMACSDP_SRC_PERIPH

     

    Destination option:

    DMA_DMACSDP_DST_SARAM

    DMA_DMACSDP_DST_DARAM

    DMA_DMACSDP_DST_EMIF

    DMA_DMACSDP_DST_PERIPH

    Regards,

    Hyun

  • Hi Hyun,

    I really appreciate your great help and quick reply.

    I finally figure out what the problem is.

    In the document SPRU433J "TMS320C55x Chip Support Library API Reference Guide", on page 2-6 (34), the example code of how to use CSL DMA, the source and destination addresses were setup with:

    myconfig.dmacssal =(DMA_AdrPtr)(((Uint16)(myconfig.dmacssal)<<1)&0xFFFF);
    myconfig.dmacdsal =(DMA_AdrPtr)(((Uint16)(myconfig.dmacdsal)<<1)&0xFFFF);
    myconfig.dmacssau = (((Uint32) &src) >> 15) & 0xFFFF;
    myconfig.dmacdsau = (((Uint32) &dst) >> 15) & 0xFFFF;

    It actually didn't work. When I revised it as:

    myconfig.dmacssal = (DMA_AdrPtr) ((Uint32)(myconfig.dmacssal)<<1);
    myconfig.dmacdsal = (DMA_AdrPtr) ((Uint32)(myconfig.dmacdsal)<<1);

    the DMA works without problem. Therefore, I suppose for this chip (C5510A), the whole address is stored in XSAL instead of XSAL and XSAU. In addition, I found that DMA_AdrPtr is 32 bits type instead of 16 bits.

    I am also wondering that if there is a updated data manual for C5510A.

    Anyway, thank you very much for your help.

    Simon

  • Hi,

    That's good to hear.

    BTW, dma example uses (CCStudio_v3.3\examples\evm5510\csl\dma\dma1_useBios)

        /* Configure lower address registers */

        myconfig.dmacssal = (DMA_AdrPtr)(((Uint32)(myconfig.dmacssal)<<1)&0xFFFF);

        myconfig.dmacdsal = (DMA_AdrPtr)(((Uint32)(myconfig.dmacdsal)<<1)&0xFFFF);

    The data manual available in the TI web site is the latest.

    Regards,

    Hyun

     

  • Hi Hyun,

    I think that configuring address registers with "&0xFFFF" probably would not work even if "Uint32" were used. And I tried this way, it didn't work. The reason might be if XSAL "&" with 0xFFFF, it will clear the upper 16 bits. In the example, this way works because it is only used to transfer data from DARAM to DARAM, which upper 16 bits were already zeros.

    Thanks.

    Simon

  • Hi,

     

    What is your memory mode? If you are not using Large model, you'll see the problem when it transfer to SARAM.

    The dma example default was using small memory model so that it worked as you described. Once I changed to Large model, the example code works with SARAM.

    Regards,

    Hyun

  • Hi Hyun,

    I used Large memory model. The version of my CCS is 2.12. Also CSL must be very old version. This bug might have been fixed already.

    Thanks.

    Simon

  • Ok. That explains it.

    Regards,

    Hyun

  • Hi Xinwang,

    I am doing the C5509 with DSP/BIOS. But I have problem find the dialog you showed there since I always use DSP without BIOS. Could you help me with open the dialog. Thanks.

    Han Zhang

  • Hi Han,

    I am not sure what you mean by "dialog". If you were talking about that image I showed, you could find it by the following steps. I assume you would use CCS 2 for doing it.

    1. Generate a DSP/BIOS file, *.cdb.

    2. In the file you just generated, go to the section Chip Support Library. Click on "+" and locate EMIF. Go to the subsection EMIF configuration Manager. If you setup DSK correctly, you should be able to see a default configuration: emifCfg0

    3. Right click on emifCfg0 and choose properties. Here is the place where I took the screen shot.

    Good luck.

  • Hi Xinwang,

    Thank you very much for your fast reply. I am right asking about the image. But I am using CCS4 and I cannot find the CSL section in the configuration tool of DSP/BIOS. Do you know how to figure it out? Thanks.

    Han

  • Hi Han,

    I have been using CCS2 and CCS3 for the designs, have never used CCS4 before. I am afraid that I may not be able to help you on that.

    However, I think using Chip Support library would be fairly easy as well. What DSP/BIOS CSL section does is just generate a c code for your graphic design.

    Why don't you use CSL directly?