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.

OMAP-L138 EDMA3

Other Parts Discussed in Thread: OMAP-L138

I'm using the OMAP-L138 eXperimenter Kit from Logic PD.  I am using the example under the "edma3_lld_01_10_00_01" packages as my starting point for setting up and using the edma3 driver in my project.  

The example I'm looking at is the edma3_test() under dma_test.c.  It was setup to dma transfer buffers of 8-bit elements.

extern signed char   _srcBuff1[MAX_BUFFER_SIZE];
extern signed char   _dstBuff1[MAX_BUFFER_SIZE];

I'm interested in doing 16-bit transfers's instead of 8-bit.  However, if I increase the buffers to signed short, I start having issues.  The dma transfer is incomplete when it gets copied to the destination address (only half of the values copied), see src and dest memory results below from one of my runs.  Is there a way to modify this example to do 16 or 32 bit transfers?    

Ex:  With a PARAM set of ACNT=16, BCNT=1, CCNT=1, DSTBIDX=16, SRCBIDX=16 

Assigning _srcBuff = 0:15

0xC4000000 _srcBuff1
0xC4000000 0x00010000
0xC4000004 0x00030002
0xC4000008 0x00050004
0xC400000C 0x00070006
0xC4000010 0x00090008
0xC4000014 0x000B000A
0xC4000018 0x000D000C
0xC400001C 0x000F000E

0xC4020000 _dstBuff1
0xC4020000 0x00010000
0xC4020004 0x00030002
0xC4020008 0x00050004
0xC402000C 0x00070006
0xC4020010 0x00000000
0xC4020014 0x00000000
0xC4020018 0x00000000
0xC402001C 0x00000000

 

  • Hi Joe,

    You have several ways to organize the ACNT/BCNT/CCNT parameters, but you have to make sure that ACNT*BCNT*CCNT = number of bytes to transfer. So in your case  you have 8x4 = 32 bytes, and ACNT*BCNT*CCNT = 16, so you can make ACNT=32 for example.

  • No matter how I set it up, it seems like only half of ACNT*BCNT*CCNT gets written to dstBuff. 

    For (ACNT=32, BCNT=1, CCNT=1), i get

    0xC4000000 _srcBuff1
    0xC4000000 0x00010000
    0xC4000004 0x00030002
    0xC4000008 0x00050004
    0xC400000C 0x00070006
    0xC4000010 0x00090008
    0xC4000014 0x000B000A
    0xC4000018 0x000D000C
    0xC400001C 0x000F000E
    0xC4000020 0x00110010
    0xC4000024 0x00130012
    0xC4000028 0x00150014
    0xC400002C 0x00170016
    0xC4000030 0x00190018
    0xC4000034 0x001B001A
    0xC4000038 0x001D001C
    0xC400003C 0x001F001E

    0xC4020000 _dstBuff1
    0xC4020000 0x00010000
    0xC4020004 0x00030002
    0xC4020008 0x00050004
    0xC402000C 0x00070006
    0xC4020010 0x00090008
    0xC4020014 0x000B000A
    0xC4020018 0x000D000C
    0xC402001C 0x000F000E
    0xC4020020 0x00000000
    0xC4020024 0x00000000
    0xC4020028 0x00000000
    0xC402002C 0x00000000
    0xC4020030 0x00000000
    0xC4020034 0x00000000
    0xC4020038 0x00000000
    0xC402003C 0x00000000

  • Hi Joe,

    With, ACNT=32, BCNT=1, CCNT=1, the original 8 word buffer was transferred...

    In your first post I saw a buffer 8 words long (each word 32 bits), now I'm seeing a 16 words long buffer (same 32 bits per word). I'm confused, what size is your buffer?

     

  • In my first post, I had a configuration of (ACNT=16, BCNT=1, CCNT=1, DSTBIDX=16, SRCBIDX=16), with my buffers elements as shorts.  My source buffer was 8 words long (each word 32 bits), each word containing two 16 bit elements as specified by my buffer declaration.  However, my destination buffer is only 4 words long, each word containing two 16 bit elements, it does not copy the last 4 words.

    extern signed short  _srcBuff1[MAX_BUFFER_SIZE];
    extern signed short   _dstBuff1[MAX_BUFFER_SIZE];

    Then, I changed my configuration to (ACNT=32, BCNT=1, CCNT=1, DSTBIDX=32, SRCBIDX=32) with my buffers also as shorts.  Now my source buffer was 16 words long (each word 32 bits), each word containing two 16 bit elements.  However, my destination buffer is only 8 words long, each word containing two 16 bit elements, it does not copy the last 8 words to my destination buffer.   

     If I change my buffers to char, everything works perfectly, my source buffer gets copied to destination correctly.

    extern signed char _srcBuff1[MAX_BUFFER_SIZE];
    extern signed char   _dstBuff1[MAX_BUFFER_SIZE];

  • Joe,

    When you change your buffers from shorts to characters the buffers are now half the size. For example, assuming MAX_BUFFER_SIZE is 32, a character buffer with that many elements is 32 bytes while a short buffer would take 64 bytes. The EDMA does not know or care about the data type of a buffer as it is designed to deal with the number of bytes it must move.

    In the first example you specified a character buffer with MAX_BUFFER_SIZE elements (32) for a total of 32 bytes, yet your EDMA configuration only transfers 16 bytes (ACNT = 16, BCNT = 1, CCNT = 1, 16*1*1 = 16 bytes transferred). This is why the entire buffer contents are moved when you change the ACNT to 32. You would need to copy 64 bytes for a 32-element array of shorts.

  • Those instructions are to create a new memory segment and configure it, however I'm interested in creating a new memory section and assign it to an existing memory segment such as IRAM.  

    For ex, the following two lines are assigning memory sections .data and .cio into DDR memory segment.

    bios.MEM.DATASEG = prog.get("DDR");
    bios.MEM.CIOSEG = prog.get("DDR");

    .cio:     {} > DDR    and   .data:    {} > DDR

    I want to create ".mydatasection".  As mentioned in previous comment, I try simply adding the following on my .tcf but I get an error message (js: "./main.tcf", line 52: property 'MYDATASECTIONSEG' doesn't exist for instance MEM). 

    bios.MEM.MYDATASECTIONSEG = prog.get("DDR");

     

  • Hi Joe,

    If you want to create a custom section, you can not edit the tcf file directly. You can have an extra .cmd file (you need to have the .cmd file that is generated by the tcf file) that specifies that section. Please see:

    http://community.ti.com/forums/p/2914/10848.aspx#10848

    So your project will have 2 cmd files.

  • As far as I know you need to do this from within the context of a linker command file as this is something for which the linker is responsible. I am not aware of any functions within TCONF that allow you to relocate user-defined compiler sections.

  • Thank you for suggestion, that worked out for me.

    My next question is about the uPP DMA.  Is it sufficient to poll the UPxS2.PEND bit to rewrite the DMA descriptor registor and not corrupt the current DMA transfer (for transmission).   If I poll the PEND bit , is it necessary to enable any of the interrupt registers to prevent any DMA transfer corruption? 

    If necessary, how do I enable a DMA transfer complete interrupt?  I am looking at the uPP user guide and I see four interrupt related registers (UPISR, UPIER, UPIES, UPIEC) and I'm unsure which one(s) I should care about to check whether the DMA transfer has completed. 

    Is there any uPP DMA Programmer's Guide available or some sample code available?

  • Joe -- you're way off topic.  Please start a new thread.