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.

TMS320F28388D: Trigger DMA from CLA background task?

Part Number: TMS320F28388D

I'm trying to use the CLA background task and the DMA to transfer data from LSRAM to GSRAM, using the CLA to DMA message RAM which is 128 bytes wide. The data I'm trying to transfer is much more than 128 bytes, so I want to transfer it in 128-byte "chunks" to a larger buffer in GSRAM. I'm trying to do this without the CPU having to poll any flags or sit in any while loops.

My current attempt has the DMA in oneshot mode. I need to be sure that the CLA background task has enough time to copy a "chunk" to message RAM before the DMA starts a new transfer, so I've set up the transfer size to be 4 so that an end of transfer interrupt is issued whenever the message RAM is full of new data. The interrupt halts the DMA, updates the destination pointers to the next chunk of the GSRAM buffer, and clears a flag to let the CLA task know that it can copy the next chunk. In theory, when the CLA is done copying the chunk it runs the DMA

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Inside CLA background task:
for(ii = 0; ii < CHUNKS_PER_PACKET; ii++)
{
for(jj = 0; jj < BYTES_PER_CHUNK; j++)
{
//just for example - pretend lsRamSourceDataPtr updates elsewhere
claToDmaMsgRamPtr[jj] = lsRamSourceDataPtr;
}
extern bool newDataInGsRam = true;
// The part I'm concerned about:
__asm(" MEALLOW");
DmaRegs.CH6.CONTROL.bit.RUN = 1;
__asm(" MEDIS");
while(newDataInGsRam)
{
// CPU interrupt at end of DMA xfer will
// clear the flag and update the destination
// shadow registers.
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

...but it does not appear that the HALT/RUN operations have any effect when run from within the CLA. Is there an extra step I might be skipping to let the CLA control the DMA, or will this just not work?

Another option would be to disable oneshot mode, set the transfer size to copy the entire source data buffer in 32-byte chunks, and software-trigger a burst from the CLA, but my guess is that if I can't run/halt the DMA I probably won't be able to do that either.

Any suggestions?

Thanks!

  • Kevin,

    I don't think CLA has access to configure DMA registers. So, you cannot do this statement inside CLA task.

    DmaRegs.CH6.CONTROL.bit.RUN = 1;

    You can probably use a peripheral trigger (may use CPU timer because CLA can write CPU timers register) to initiate DMA transfer from CLA.

    Regards,

    Manoj