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.

EDMA3 problem

Hello, I'm using a C6748 single DSP. I'm using EDMA for a new function in my application and I'm encountering a werid problem when I set the source's offset to a negative value.

What I'm trying to do is that given an array of 4 elements {1,2,3,4}. I'll organize them in the following fashion: {11...1, 22..2, 33..3, 44..4} into another space of memory, but the initial array is fixed at the moment but won't be in RT execution, because of this the data has to be stored in order. This are the values I have:

  • SRC: pointer to initial array
  • DST: pointer to final array
  • A_B_CNT: (2 << 0) | (4 << 16)
  • CCNT: sample_size
  • SRC_DST_BIDX: (2 << 0) | (2*sample_size << 16)
  • SRC_DST_CIDX: (-3*2 << 0) | (2 - 2*3*sample_size << 16)
The problem I'm encountering has to do with the negative value in the source's offset for the CCNT. In the destination the negative offset works perfectly and it allows me to store the data the way I want to. But in the source it gives me a problem and the program doesn't even start. If I set the source's offset to zero the program runs but of course it only works in the first occurence of the event as in later occurences the source index is out of range of the initial array and the data I collect is giberish. 
The Technical Reference Manual states that the values for the source's offset range between -32768 and 32767 so it shouldn't present any problems.
I would appreciate any help.
Regards,
~ Aquiles Lacruz

 

  • Hi Aquiles,

    Thanks for your post.

    The Source C Index parameter (SRCCIDX) is basically a 16-bit signed value which is specified in 2's complement and that will be used for source address modifcation between each array in the 3rd dimension. Could you please catch the exact value of source offset for the CCNT and check whether the value lies between 0 and FFFF in hexadecimal?

    Convert the exact negative value in the source offset for CCNT into its hexa decimal equivalent and check whether the source index falls out of range of the initial array? You shall put a breakpoint  in the code and catch the values in a watch window for the corresponding source index variable.

    Also, please note that, when SRCCIDX is applied, the current array pointed by the SRC address in an A-synchronized transfer is the last array in the frame while the current array in an AB-synchronized transfer is the first array in the frame. So, Kindly validate this note for the byte address offset of SRC in your case.

    Thanks & regards,

    Sivaraj K

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

     

     

  • Hello Sivaraj,

    Thank you for your quick answer, it did indeed work using a Hex for the value instead of a decimal number. But this gives me another problem as in the real appication, this number will depend on a variable that will be set on initialization.

    So the source offset in the ccnt will be something like (-2*x) how can I convert that to hex to put in the source's offset. I've been trying to use a 16 bit variable to do the thing but for some reason the program won't run. I'll keep trying this approach unless you come up with a better solution.

    Thanks again for the quick and helpful answer.

    Regards,

    ~ Aquiles Lacruz

  • The exact formula I need there is: (-2*(NUM_CHAN-1)) where NUM_CHAN is a variable set on initialization and never changed again.

    In my test NUM_CHAN is 4, so the Hex would be 0xFFFA for the source's offset and using this value it works. But I've tried using a 16bit variable to store the result of (-2*(NUM_CHAN-1)) and then using it for setting the value of the offset and it doesn't work. The weird part is that it doesn't even start. I mean when I use this variable the program stalls and I don't even get to see if it works or not or even the stored value in the EDMA register.