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.

transfert DATA from externanl memory DDR to internal memory LL2RAM using EDMA3 of C6472 DSP

Hi,

I'm working on C6472 DSP using DSP bios v5 and CCS v4.2

I want to use EDMA to copy a buffer from external memoy DDR to internal memory LL2RAM.

It's the first time that I work on EDMA3. I tried to the example exists in csl_c6472->EDMA->edma_ping_pong_xfer_gbl_reg ...this example is created with CCSv3

So I tried to use the source files and I created my own project on CCSv4 and I add the DSP_bios_configuration.

in this example the buffers are declared globally:

Uint8       srcBuff1[512];
Uint8       srcBuff2[512];
Uint8       dstBuff1[512];
Uint8       dstBuff2[512];

As I want to transfert data from external to internal memory I created two heaps : one in DDR and one in LL2RAM and I replaced the declaration of the buffers by this code in my project:

unsigned char * srcBuff1 = (unsigned char*)MEM_calloc(DDR_Heap, sizeof(unsigned char)*buffer_size, 8);
 unsigned char * srcBuff2 = (unsigned char*)MEM_calloc(DDR_Heap, sizeof(unsigned char)*buffer_size, 8);
 unsigned char * dstBuff1 = (unsigned char*)MEM_calloc(LL2_Heap, sizeof(unsigned char)*buffer_size, 8);
 unsigned char * dstBuff2 = (unsigned char*)MEM_calloc(LL2_Heap, sizeof(unsigned char)*buffer_size, 8);

what happen is when I allocated the srcBuff and the dstBuff both in the DDR_Heap , the transfert was passed but when I allocated the srcBuff int DDR_Heap and the dstBuff in the LL2_Heap( internal memory) the transfert was failed. So could someone tell me what's the problem...

Could this problem is related with the EDMA region or the EDMA3 Channel Synchronization Events?

 /* Module setup */
    dmahwSetup[CSL_EDMA3_CHA_TEVTLO6].paramNum = 0;
    dmahwSetup[CSL_EDMA3_CHA_TEVTLO6].que      = CSL_EDMA3_QUE_0;
    hwSetup.dmaChaSetup = &dmahwSetup[0];
    hwSetup.qdmaChaSetup = NULL;
    status = CSL_edma3HwSetup(hModule,&hwSetup);
    if (status != CSL_SOK) {
         printf ("Hardware setup failed\n");
         CSL_edma3Close (hModule);
         return;
    }
           
    /* Channel open */
    chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
    chAttr.chaNum = CSL_EDMA3_CHA_TEVTLO6;

/*********************************/

if there is a relation between this problem and these parameters, so could you please give me the appropriate parameters to transfert a buffer from external memory DDR to internal memory LL2RAM.

Best regards

David





   
   

  • David,

    David wilson said:
    what happen is when I allocated the srcBuff and the dstBuff both in the DDR_Heap , the transfert was passed but when I allocated the srcBuff int DDR_Heap and the dstBuff in the LL2_Heap( internal memory) the transfert was failed.

    Could you explain in more detail what you mean by "transfer failed"? Did the transfer not happen at all? Did it set some error event?

    If you used the same EDMA configuration successfully with src/dst in DDR memory, it should not be any different when one of the buffers is moved to L2. Without more details on the failure, I cannot say whether or not there is a relation between your configuration and the failure but my initial guess is no.

    When you place an EDMA buffer in L2, do make sure that you configure the paramset using the global L2 address since EDMA does not support local addresses. i.e. if using DSP0 L2, use 0x10800000 instead of using 0x00800000, if using DSP1 L2 use 0x11800000 and so on.

  • Hi Aditya,

    Thank you for your replay.
    First, what I mean with "the transfert was failed" is, the transfer not happen at all.
    Second, you said "When you place an EDMA buffer in L2, do make sure that you configure the paramset using the global L2 address since EDMA does not support local addresses. i.e. if using DSP0 L2, use 0x10800000 instead of using 0x00800000, if using DSP1 L2 use 0x11800000 and so on".
    what you said is right...when I view the memory adress of dstBuff I found 0x00800000...so how can I allocate the dstBuff  in 0x10800000 because when I used this ccommand unsigned char * dstBuff1 = (unsigned char*)MEM_calloc(LL2_Heap, sizeof(unsigned char)*buffer_size, 8); ( LL2_Heap is a heap memory that I created in LL2SRAM using DSP_Bios Configuration) the adress of dstBuff1 will be 0x00800000.

    Best regards,

    David

  • David,

    For DSP0, 0x10800000 and 0x00800000 are one and the same i.e. you can consider 0x10800000 to be an alias for 0x00800000. The EDMA operates using the global address but it will be accessing the same data that is present in 0x00800000. So you need not change where the buffer is allocated. You just need to program 0x10800000 into the paramset instead of 0x00800000.

    An easy way to convert a local l2 to global l2 address is to use this routine: You pass the local address 'addr'. The return value is a global address.

    Uint32 global_address (Uint32 addr)

    {

    Uint32 corenum;

    corenum = CSL_chipReadReg(CSL_CHIP_DNUM);

    addr = addr + (0x10000000 + corenum*0x1000000);

    return addr;

    }

  • Hi Aditya,

    Thank you very much... the problem is solved and the transfert was passed correctly.

    Best regards

    David