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.

6747 edma3 cannot work

Other Parts Discussed in Thread: TMS320C6747

hello:

   I just want to relize a simp;e transfer from sdram to dspl2ram  though EMDA3,and here is code ,but it doesn't  work.Please help me. (My chip is C6747)

/*main*/

#include "stdio.h"
#include "C6747.h"

void WriteSdram();
void InitEDMA3();
Uint32 *DSPL2RAM =(Uint32* )0x11800000 ;

void main()
{
 // int i=0;
   C6747_init();
   WriteSdram();
   InitEDMA3();
//   EESR=1;
   ESR=0x1;
   if(*(DSPL2RAM+255)==255)
   printf("Write DSPL2RAM SUCCESS!\n");
   else
   printf("Write DSPL2RAM error\n");
  /* for(i=0;i<256;i++)
   {
    *(DSPL2RAM+i)=i;
   }*/
  
  
}

/*sdram*/

#include "stdio.h"
#include "C6747.h"

void WriteSdram()
{
    Uint32 i;
    Uint32 *SDRAM_StartAdd;
    Uint32 Length=256; //长度最长应为ox20000000
    SDRAM_StartAdd = (Uint32 *)0xC0000000;//EMIFB的起始地址为0xc0000000,EMIFB连接两块SDRAM
    for( i=0;i<Length;i++)
    {
     *(SDRAM_StartAdd+i)=i;
    }
    if(*(SDRAM_StartAdd+255)==255)
     printf("Write SDRAM Success!\n");
    else
    printf("Write SDRAM error!\n"); 
}

 

/*edma3*/


#include "C6747.h"

void InitEDMA3()
{
  CCCFG=0x00003005;
  PARSET0_OPT=0X00100009;
  PARSET0_SRC=0xC0000000;
  PARSET0_A_B_CNT=0x00010100;
  PARSET0_DST=0x80000f00;
  PARSET0_SRC_DST_BIDX=0x00000000;
  PARSET0_LINK_BCNTRLD=0x0000ffff;
  PARSET0_SRC_DST_CIDX=0x00000000;
  PARSET0_CCNT=0x00000001; 
   ESR=0x1;
  //IPR=0x00000001;
}

 

 

Thank you!

  • Juzheng Zhang,

    Please look through the support files that come with the C6747 to find an example EDMA3 transfer program. Or you can download the latest support files for the C6747 from your board vendor (if it is an EVM) or from links on the TMS320C6747 Product Folder page.

    The things you will consider in a transfer program are:

    - Bytes vs. Words
    - How the C language handles pointer math
    - Matching target addresses from one function to another
    - How to use the IPR register to know when a transfer is complete
    - If L2 cache is enabled, how to use cache coherency commands
    - Use CCS to step through the program and view memory contents
    - Use CCS to debug your program

    Regards,
    RandyP

  • Thank you very much.

             Today afternoon the communcation of SDRAM and dspl2ram is successful, but   I  have met a new problem, It is that I should set the  A_B_CNT four  times of the number I want to transfer,for example ,if I want to transfer 256 Bytes,I should set the A_B_CNT 1024,I am very confused about this, Can you help me?Also, can you tell me where can I find some examples for 6747 EDMA3 . thank you !

       Good luck

  • Hi Juzheng,

    Thanks for your post.

    There are rCSL examples available which comes as part of BIOS PSP and the example code shall be available for download as below:

    http://processors.wiki.ti.com/index.php/QuickStartOMAPL1x_rCSL

    In the above package, there are EDMA examples which performs basic memory transfer and are applicable to OMAPL137 devices but the OMAPL137 DSP side examples should be compatible with the c6747 EVM.

    You could also find PSP EDMA examples which is usually located in the PSP installation directory and you can find it in the \packages\ti\pspiom\examples\evm6747 directory. Please check it.

    Please refer the getting started guide for C6747 as below:

    http://processors.wiki.ti.com/index.php/Getting_Started_Guide_for_C6747#Loading_Example_Software

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------
  • Juzheng Zhang,

    RandyP said:

    The things you will consider in a transfer program are:

    - Bytes vs. Words

    The number you put in the ACNT field will be the number of bytes that you want to transfer in a single A-Sync event. Since OPT.SYNCDIM=0, you are doing a single A-Sync transfer per DMA trigger event.

    If you are consuming the data as Words, then you will need to adjust the number of Bytes transferred to match the number of bytes to be consumed. In the C6000 architecture, one Word = 4 Bytes. One C element of datatype "int" is a Word = 32 bits = 4 bytes. You can reference the C Compiler User Guide for more information on available datatypes and their corresponding sizes.

    Do not set OPT.SAM=1 or OPT.DAM=1. Please read the description fields of the SAM and DAM bits in the EDMA3 User Guide for more information.

    Regards,
    RandyP

  • Thank you RandyP

                 Thank you for my answer,problems  has been solved,Thank you very much.

      Good luck!

  • Thank you  Sivaraj K   for you help ,Good luck!