I am having a problem using McBSP-DMA on the 5517. I can get data
to our RAM buffer, but I have to do weird things with DMA frame length
and RAM buffer element size to do so.
I am using the McBSP to bring in 9 bytes at a time per timeslot,
triggered on a per-timeslot basis using external clock FSR.
I set the McBSP word length RCRL:RWDLEN1 to be 8 bits, and frame length
to be 9 words by setting RCRL:RFRLEN1 = 8.
Our data chunk consists of 16 timeslots It is this chunk that
we are DMA'ing to RAM (in this case internal SARAM).
So I thought my DMA transfer size would be 9 bytes/timeslot * 16 timeslots = 144.
I have set the DMA transfer size to be 144 (DMA3:DMACH0TRCL) with interrupt
enabled, and I get the interrupt. The DMA destination and source addresses
are all OK. DMA burst mode is set to 0 = 1 double word.
But when I look at the receive RAM buffer, a word array 144 elements
in size, I'm not seeing what I expect. I only see expected data once in a
while as I hit the DMA ISR breakpoint. My Uint16 rcvBuff[144] is not working.
Here's what "fixed" it - if I change the DMA length (DMA3:DMACH0TRCL)
to be 576, 4 times my 144 bytes in, and change the element size of my
receive buffer to be 32 bits, ie Uint32 rcvBuff[144], I see my data.
I see the Nth byte of my expected data in the Nth element of my receive
buffer. So for example if my data is sequential I'll see this:
McBSP in data DMA destination receive buffer
first byte 0 rcvBuff[0] = 0x0000000
second byte 1 rcvBuff[1] = 0x0000001
third byte 2 rcvBuff[2] = 0x0000002
...
144th byte 143 rcvBuff[143] = 0x000008F (143d)
The data is getting through to RAM, just not how I want or expect.
--I have to make the DMA length 4 times the size of the data
--I have to make the receiving buffer elements 4 bytes in size.
I figure I have something misconfigured, just not sure what.
I'd like to have my receive buffer to be a word array: Uint16 rcvBuff[144]
and I'd like my DMA length to be 144. Or know why not.
Can anyone shed any light?
Thanks,
Steve