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.

C Addressing CCS 5.2

Hello,

I am working through CSL_DMA_PingPongExample on my C5535 EzDSP board.

Using CCS 5.2.0 on Ubuntu 11.04, the Memory Browser in CCS is indicating that bytes are written to the array dmaPingSrcBuf[] but the array is declared in C as a Uint16:

/* Declaration of the buffer */
#pragma DATA_ALIGN (dmaPingSrcBuf, 4)
Uint16 dmaPingSrcBuf[CSL_DMA_BUFFER_SIZE];

Uint16 index;

So

for(index = 0; index < CSL_DMA_BUFFER_SIZE; index++)
{
dmaPingSrcBuf[index] = index;

}

should write a 16-bit value, right? Even though DMA uses byte addressing, this is C.

Instead I get: 0x0000B5DC 0100 0302 0504 etc. where I expect: 0x0000B5DC 0000 0001 0002

Thanks

  • Hi,

    Please check attached; I didn't see the same issue as you. However, I used the typedef uint16_t from the compiler include file <stdint.h> instead.

    I am not sure how the type Uint16 is being defined (char, int or something else), therefore in this case I suggest you to experiment with other typedefs and see if the behaviour changes. One interesting thread about this subject is here.

    Hope this helps,

    Rafael

  • I'm not familiar with the C55xx family, but generally speaking a DMA unit can perform transfers in more than one way, so what shows up in the destination buffer depends on how the DMA is programmed.  Check that out and see if it explains the behavior.

     

  • The nature of the problem is a bit unclear to me, but I suspect your problem comes from the fact that on C55x, one byte is 16 bits.

    Does that for loop appear exactly like that in the source code?  If so, I would expect the output you're expecting.  In what way is the DMA involved here?