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.

Using EDMA in DM6437

Hi! i want to use EDMA in DM6437. but first i have to learn EDMA usage. is there a any document or example code that i can learn?

Thanks

  • I recommend you to first understand the architecture. It also has multiple examples, with illustrations in Section 3.

    http://focus.ti.com/lit/ug/spru987a/spru987a.pdf

     

    Also - there is EDMA driver with some good examples at :

    http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?sectionId=3&tabId=409&literatureNumber=spraan4a&docCategoryId=1&familyId=1301

     

    Hope you can come up to speed.

    Varada

  • Hi Varada. Thanks for your reply. im making some edma block copy implementations by help of ti documents. but i want do below copy;

     1D Array to 1D array copy but for example source data is  : XYXYXYXYXYXYXYXYX destination data is just YYYYYYYYYYY. i want to sort X values

     

    How can i do this? how must be parameters like DSTBIDX, SRCBIDX or ACNT ext.?

    Thanks

  • See example 3.3, for data sorting in the EDMA user guide.

  • i  solved problem using that example : C:\dvsdk_1_01_00_15\examples\edma3_lld_01_11_01_04\examples\edma3_driver\evmDM6437\ccs3.

    But i have to use edma in video_preview example. i write all functions like in edma3_driver example but . there is something wrong. i couldnt copy source to destination. i tried to changed DSP/Bios configuration like example. this time edma copy source to destination but wrongly. like 

    source 0, 1, 2, 3 ......99

    destination 0, 0 , 0 , 0 , 0 , 32, 33, 34, 95, 0, 0,0,0

     

    do you have an idea Varada for this?

  • Ayhan,

    Can you please post this is as a separate question, so that I can forward it to the appropriate expert. Or you can post this question on the DSP/BIOS forum.

    Thanks

    Varada

  •  in video_preview project, video_preview.tcf file calls common.tci . in common.tci file somthing effect my edma usage.i tried but i coulndt find. if i dont call common.tci edma work correctly.

     

    Thanks.

  • Hi Varada. Now i realized that i cant use edma after first usage. i coulndt copy any mem block after first usage. edma copies mem block for first time correctly but after that it gives up copying?

    Do you have an idea for this problem Varada?

    Thanks

  • PLease submit a new post describing the details of the software driver you are using and I will forward it to the correct expert. DO not use this thread, as it cannot be moved.

    Thanks

    Varada

  • Hi Varada. i have a problem about edma usage more than once. if i explain this with an example :

    my array is integer and acnt is 4, bcnt is 100, ccnt is 1. srcbinx = 8, dstbinx = 8 

    source: 

    0, 1, 2, 3, .........199,

    destination :

    0,0,2,0,4,0,6,0,8,0,10,0.....................198,0,

     

    for the first time edma function works correctly but when i call edma like first time and same source and destination array with change its values at begging output is changing.

    like 

    output:

    0,02,0, 4,0,6,0....................................... 108,0,110,0, 0,0,0,0,0,0,0 .......

    do you have an advise for this?

     

  • It should not happen.

    On the second time, from looking at output, I see all 0s after 110 .....

    Can you fill the destination with some value before you start the EDMA. Let me know if it was overwritten by source data or it remained the same.

    Also check for any errors : Refer Appendix A1, A2 of User guide.

    Hope this helps.

  • according to me it shouldnt happen too.i think im missing something.  im filling dstination with 0 value before every call. i have to add this that if i select srcbix = acnt and dstbix = acnt there are no copy error. but if i choose srcbix = 2 * acnt and dstbix = 2 * acnt error happen at this time. but for first call there is no problem.

  • Hi Varada,

    i solved problem by changing some configurations on dsp/bios settings. it works correctly now. but it couldnt work speedly. im loosing real time by calling edma lots of time. is this happen because of dsp/bios or do i have to add somthing too? can you check my tcf and edma files please?

    5852.dm6437.rar

  • ayhan said:

    i solved problem by changing some configurations on dsp/bios settings. it works correctly now. but it couldnt work speedly. im loosing real time by calling edma lots of time. is this happen because of dsp/bios or do i have to add somthing too? can you check my tcf and edma files please?

     Ayhan,

    What settings did you changed on dsp/bios? In the application there is a compilation flag "EDMA3_ENABLE_DCACH". Is this flag enabled?

    Also please provide more information on the issue of loosing real time by calling edma lots of time.

     

    Regards,

    Nag

  • im new at dsp/bios configuration. i did small changes like unit main.tcf and video_preview.tcf files bios configurations. but i have to eject common.tci file. im sending my tcf file and edma c file. could you check what is my wrong?

    i mean by loosing real-time. im callig edma functions between video frames. between capture and display. so that edma takes lots of time and i coulndt see video continuously

  • 7652.DM6437.rar

     

    My current tcf file and dma file could you check where is my fault about speed problem please?

    Thanks

  • Ayhan,

    I went through the source code but could not figure the issue. In the dma_test.c file, there is only one function edma3(), which can transfer the data when the edma handle, src, dest etc parameters are given.

    1. What is the application you are using to trigger the transfer, jin which the function edma3() is called?
    2. I understand intially the issue was the data transfer was not happening correctly
    3. Later the issue got resoloved after changing some BIOS settings? Please explain what exactly was changed in the BIOS configuration?
    4. But now the problem is the time taken for data transfer is slow. Am I correct?

    Regards,

    Nag

  • i was using video_preview project and so that my tcf file is same as video_preview tcf file. but when i use edma in this project. i realize that edma didnt copy correctly so that i added to dsp/bios settings to looking edma3_driver project which is in edma3_lld_01_11_01_04\examples\edma3_driver. most useful change for me that i dint call  common.tci in video_preview example. if there isnt slow process problem in my project video is working correctly edma is copying correctly. now im sending video_preview.tcf and edma3_driver.tcf and my tcf file.And  im sending all my project that you can see edma3 function call. could you check them please?

    Thanks.

    2746.DM6437.rar

  • Ayhan,

    I went through your code.

    The edma3() function is getting invoked from the videoStabilization() function. Here is the code snippet I went through. Based on this assumption I have given few comments after the code.

    videoStabilization()

    {

    ................

    /* grab a fresh video input frame */
        FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);
        //process_imagebw( (void*)(frameBuffPtr->frame.frameBufferPtr),  height, width);
    // phaseCorrelation( (void*)(frameBuffPtr->frame.frameBufferPtr),  32, 32);

     //phaseCorrelation2( (void*)(source),  32, 32);
        //edmaResult = edma3(hEdma, source, (void*)(frameBuffPtr->frame.frameBufferPtr) , 0, 0, 4, 60000, 14, EDMA3_DRV_SYNC_AB, 1);
      for(i = 0;i < 2 * N * N* N; i++)
      edmaResult = edma3(hEdma,lineOut , FFTOut , 0, i,  4, N, 1, EDMA3_DRV_SYNC_A, 2, 2 * N);

        /* display the video frame */
     //printf("FFT....! \n");
        FVID_exchange(hGioVpbeVid0, &frameBuffPtr);

    ................

    }

    Here are few comments:

    • I don't know what exactly is the app trying to do. But as per the above code between capture and display, the edma3() function is getting called for (2*N*N*N) times = 8192 times (since N=16). Do you need to call the edma3 function this many times? What is your requirement on the time limit between capture and display and have you measured the time taken by each edma3() call?
    • Also I observed you are using "EDMA3_DRV_SYNC_A" mode. Cant this be replaced by the "EDMA3_DRV_SYNC_AB" transfer mode. This reduces the number of interrupts to the CPU.
    • Other than this I don't have any other comments

    Regards,

    Nag

    --------------------------------------------------------------------------------------------------------------
      Please click the Verify Answer button on this post if your question is answered
    --------------------------------------------------------------------------------------------------------------

  • i will use edma in 2d FFT. for this i have to call edma functions for every row and column to take fft and write back them to result array by edma. and i tried this between frames and im loosing speed. and when i tried EDMA3_DRV_SYNC_AB edma doesnt copy elements after 4096. so that i chose EDMA3_DRV_SYNC_A. why its happennin i dont know?and is this problem about dsp/bios confuguration or its good enough?

    Thanks

  • Ayhan,

    I have few comments on the implementation and invocation of edma3() function in your application.

    • Improve the efficiency of the edma3() function in your application
      • The channel request and free need not be done so many times. It can be done once before starting the transfer (before the for loop) and then freed after all the data is transferred (after the for loop).
      • The only parameter that is getting changed each time you call edma3() function is the "value of i". Could you see how this can be avoided and a single call can transfer all the required data.
      • After triggering the transfer the control is waiting in a while loop. This will not allow any other task in the system to run. Instead the application can pend on a semaphore and the same can be posted in the callback function.
    • I too dont understand the reason why the AB sync transfer should fail after 4096 times?
    • Please go through the edma examples and fully understand the usage (examples\edma3_driver\src\dma_test.c). This will help in identifying the issues in your application and also you can identify the areas for more effiencient transfer of data .

    Regards,

    Nag

    --------------------------------------------------------------------------------------------------------------
      Please click the Verify Answer button on this post if your question is answered
    --------------------------------------------------------------------------------------------------------------

  • Thanks. i will look all steps that you said. is there anything i have to add tcf file. and i couldnt implemented common.tci in video_preview example. Do you have an idea for this?

  • Ayhan,

    I don't have any idea if there needs to be any more thing added to video_preview tcf file. If you doubt that because of some issue in the tcf file, the performance is affected, your can do a simple check.

    Transfer some data using the original sample app in the edma3 lld release and measure the time taken there. Repeat the same transfer in your setup and measure the time taken. Compare both of them if you find any difference.

    Regards,

    Nag

  • i used to did everything looking edma3_driver example. But i will try again form scratch. i have to say that when i call edma like this : 

    edmaResult = edma3(hEdma, source , previousFrame, 0, 0, 4, 60000, 14, EDMA3_DRV_SYNC_A, 2, 2);

     

    it loosing time for one call. not in a loop. i will check edma again. after that i will share results.

    Thanks.

  • Hey Ahyan

    Did you get your phase correlation running? I've got the same problems using the edma.
    I tried to use the DAT module as well (edma3_lld_01_10_00_01\examples\CSL2_DAT_DEMO), similar results...

    best
    hitsch