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.

About how to use EDMA3 in the DSP server on DM6467 EVM with ACPY3 and DMAN3 in framework_component???

I would like to improve the DSP server-side processing algorithms on DM6467,so I will use EDMA3 in the DSP server-side algorithms . I first control EDMA3 with the related registers ,then it can't work ,so I use the API functions for example ACPY3 and DMAN3 ,which were provided by the framework_component in DVSDK_1_4... ,but it also can't work . And I won't find a successed example program which can give typical examples how to use EDMA3 based on DVSDK,please help me !!!!!

  • What version of Framework Components are you using ?!

    All Framework Components releases come with an example called 'fastcopy' that demonstrates how to use DMAN3 and ACPY3 in an algorithm context to perform hi-speed memory transfers.

    Depending on the release you are using, you may even see an example specifically for DM6467.

  • Thanks, my Framework Componets version is 2_10_02.

    And I have seen the example 'fastcopy' ,but I compiled this example  based on Linux unsuccessfully , I also compiled the other verion,the result was same , so I don't know why ?

    Yesterday ,I can directly use EDMA3's register to control DMA working in DSP server , but I only use the channel 0 , the other can't work ,and I found that result also is wrong ,I think that something setting about server's CFG is wrong , please give me some suggestion , that is grateful.

  • - The "fastcopy" example is a DSP-only Framework Components only example so it is understandable that you couldnt build it for Linux.

    - In Codec Engine 2.10 releases, you could try looking at the video1_copy example that is a complete example that is also built for evmDM6467. The example instantiates a videnc1 codec. DMAN3 is used to grant resources to the codec and in the process call, that codec uses ACPY3 to perform DMA transfers.

    codec_engine_2_10_02/examples/ti/sdo/ce/examples/apps/video1_copy

    The codec that uses ACPY3 is at:-

    codec_engine_2_10_02/examples/ti/xdais/dm/examples/videnc1_copy

     

    Looking through the above should help you how to configure DMAN3 in your server config file to provide resources to the codec and then use ACPY3 in your codec to perform the actual DMA transfers.

    Gunjan.

  • Thanks , I will try , and I have another question:

    I had directly contorl EDMA3's register to transfer data in DSP's server algorithm, like that:

            #define EDMAADDR 0x1C00000////##############
           unsigned int edmaChan = 0;  ///////////////////channel
           unsigned int bytes = 6400;
           unsigned char *src   = (unsigned char *)inBufs->descs[0].buf;
           unsigned int *mdst  = (unsigned int *)0x11818000;
           unsigned int tccNum = (unsigned int)-1;
           pEdma = (unsigned int* )EDMAADDR;
           /* Set param 1 */
          pParam = (unsigned int *)((unsigned int) pEdma + 0x4000 +(0x20 * edmaChan)); //param # edmaChan
           tccNum = (edmaChan << 12);
          pParam[0] = (0x00100008 | tccNum); //OPT TCC == edmachan + STATIC
          pParam[1] = (unsigned int)src;
          pParam[2] = 0x00010000 + bytes; //Bcnt, Acnt
          pParam[3] = (unsigned int)mdst;
          pParam[4] = 0x0;
          pParam[5] = 0xFFFF;
          pParam[6] = 0x0;
          pParam[7] = 0x1;
          /* SECR = 0xFFFFFFFF */
          *((unsigned int *)((unsigned int) pEdma + 0x1040)) = 0xFFFFFFF;
          /* ICR */
         *((unsigned int *)((unsigned int) pEdma + 0x1070)) = (0x01 << edmaChan);
         /* DCHMAP */
         *((unsigned int *)((unsigned int) pEdma + 0x100 + (0x4 * edmaChan))) =(edmaChan << 4) ;
         ipr = (unsigned int *)((unsigned int)pEdma+ 0x1068);
         /* ESR = 0x02 */
         *((unsigned int *)((unsigned int) pEdma + 0x1010)) = (0x01 << edmaChan);
         /* Check for completion */
         while (((*ipr) & (0x1 << edmaChan))  != (0x01 << edmaChan));

         I did nothing about the DSP server's CFG provided by the dm6467_dvsdk_combos_1_17 in DVSDK ,
    but I found that  only channel 0 can work , the other's can't , and whether all that I had done can affect the other compnents which also had used the EDMA3 .

  • Thanks , I had writen a program like the example videnc1_copy ,like that:

         unsigned int length ;

         int i = 0;
          unsigned int bytes = 6400;
        unsigned char *src   = (unsigned char *)inBufs->descs[0].buf;
        unsigned char *dst   = (unsigned char *)outBufs->descs[0].buf;

          length = width * height * 2;
     
          ACPY3_activate(Obj->dmaHandle1D1D8B);

     while(length > 0)
     {
      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
          
         /* Configure the logical channel */
            params.transferType = ACPY3_1D1D;
            params.srcAddr      = (void *)(src + i * 6400);
            params.dstAddr      = (void *)(dst + i * 6400);     

            params.elementSize  = bytes;
            params.numElements  = 1;
            params.waitId       = 0;
            params.numFrames    = 1;

            /* Configure logical dma channel */
            ACPY3_configure(Obj->dmaHandle1D1D8B, &params, 0);

            /* Use DMA to copy data */
            ACPY3_start(Obj->dmaHandle1D1D8B);

            /* wait for transfer to finish  */
            ACPY3_wait(Obj->dmaHandle1D1D8B);
             i++;
             length -= bytes;
     
     }
     
     ACPY3_deactivate(Obj->dmaHandle1D1D8B);

    and this DSP server's CFG also do something like the example videnc1_copy .

    but , this application still can't work,why?

  • Did you try just building and running the video1_copy example on your board ?! I'd like to know that you were able to run something successfully on your end and then you can maybe start to customize it to your usecase?!

     

  • Thanks , we developed a camera based on DM6467 , it can capture images in JPEG format . Then we want to improve the processing speed through the EDMA3 , because I have some algorithms which affect encoding speed very much , these algorithms mainly  are pre-processing  the original data which should be BAYER , RGB or YUV . 

    And I had compiled  many DSP's server versions.

    One version that directly control EDMA3's registers can work , but only channel 0 is normal, and the result image in the horizontal direction of the line get random errors ; the other channels can't work , besides the application front-end can't collect data.  

    One version that compiled with the ACPY3's API , no channel works, also the application front-end can't collect data.

    The versions not built by EDMA3 or ACPY3 is OK , but the process speed is discontent.

     

    thus I didn't successfully customize any available versions in this situation. please help me.

  • Are you working with any TI FAEs ? At this point, I'm not sure whether your issue has to do with Framework Components. (Since you've had issues using the EDMA3 hardware directly etc).

    Again, I will not be able to help with your application front-end issues.

    The example I pointed you at, is a good example of a DM6467 application that uses a server that requests resources using DMAN3 and uses ACPY3 to perform transfers. I'd be good to start with that example, get that running successfully, and then modify that for your purpose. Also if there are drivers etc on your system that use DMA resources, the DMAn3 configuration will have to be modified to ensure mutual exclusion of resources.

  • THanks , my application could work normally with ACPY3's API , but I have some questions about this API , please help me.

    1 I didn't how to config EDMA3 channel through ACPY3's API ?

    2 And when write a program like that:

        unsigned int bytes = 6400;
        unsigned char *src   = (unsigned char *)inBufs->descs[0].buf;
        unsigned char *Ydst  = 0x11818000;  ///   IRAM
     
         ACPY3_activate(Obj->dmaHandle1D1D8B);
            params.transferType = ACPY3_1D1D;
            params.srcAddr      = (void *)src ;
            params.dstAddr      = (void *)Ydst;
            params.elementSize  = bytes;
            params.numElements  = 1;
            params.waitId       = 0;
            params.numFrames    = 1;

            /* Configure logical dma channel */
            ACPY3_configure(Obj->dmaHandle1D1D8B, &params,0);

            /* Use DMA to copy data */
            ACPY3_start(Obj->dmaHandle1D1D8B);

            /* wait for transfer to finish  */
            ACPY3_wait(Obj->dmaHandle1D1D8B);
     
           ACPY3_deactivate(Obj->dmaHandle1D1D8B);

    so the application wasn't normal , the result like that result had getten before , whether ACPY3's API can't support IRAM?

    3 I still add some IO operations to control IO output in the application and the DSP's server , there is 8 miliseconds lag between the dispatch of command from application and the execution of dsp server. moreover,  the counter-directional operation also has 8 miliseconds lag.  Isn't the 8 ms result astonishing?

  • -I'm assuming the given example did work for you with ACPY3 but after you made some changes it stopped working ? Is that correct ?

    - Can you list out all the changes you made to the WORKING ACPY3 example ?

    - ACPY3 should work just fine with IRAM as the destination address, is that the only thing you changed in your working example ? Are you sure that address is in IRAM and not in some cached memory ?

    I don't know much about  the 8 ms lag issue, maybe some Apps. experts can respond here.

  • Thanks , I has solved my problem about ACPY3's API , the reason is that the address 0x11818000 can't operate , the other is right . So I now think about the multi-channel transmission of EDMA3 , but I had read some documentations and examples , are these really multi-channel transmission , please give some suggestions?

  • Xiang,

    I'm happy to see that the forum is helping you in getting your development done.  It appears from your latest response that the question that started this thread has been resolved, so I would like to encourage you to post any new issues and questions that you have as new threads, rather than adding it on to the existing thread.  This will have several benefits, not the least of which is to make your question more prominent and likely to be answered sooner.  It will also help others who have similar issues to find your post more easily, thereby spreading the "wealth".

     

    Many Thanks,

    Dave Friedland

    Forum Moderator

  • where are macro  CACHE_ENABLED  and  USE_ACPY3, or how should i define them . i mean if i put them in head of their files and compile it ,it doesn't work any more

  • Please start a separate thread with more information about what you are trying to accomplish and what issues you are facing.

    Thanks,

    Gunjan.

  • hello,

        Recently i try to test fastcopy in fc,i find it seems the fastcopy example cann't work in dsp,so i guess it will work in ccs,but when i put it in ccs and compile it ,there is something wrong which take out "cann't find xdc/std.h",i am amazing,could you tell me why and how to deal with it ?thanks!

  • Please start a new thread with your question and also provide details of the "device" you are using and version of "Framework Components" you are using. This thread is closed.