DMA does not transfer data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10696
Level 4
Level 4
First solution authored
I am trying to use the DMA (GPDMA0) to transfer 150 Bytes of data from a memory buffer to a USIC (USIC1_CH0) set to SPI mode on a XMC4500.

I have configured the USIC for SPI and I can use it to send data using Interrupts.
I have enabled the GPDMA0 and configured channel 3 for single block transfer:
CTLL = 0x00100101
CFGL = 0x000008E0
CFGH = 0x00001804
Source and Destination Registers are correct



The DLR is also configured:
SRSEL0 = 0x0000X000
LNEN = 0x00000008



The USIC is configured to generate a Service Request 1 on a transmit buffer Interrupt:
CCR = 0x00002001
INPR = 0x00000010



When I enable the DMA channel the source is read (8 Bytes) and the FIFO is not empty, but no data is written to the USIC. If I Trigger a transmit buffer Interrupt with the Software the first Byte of data is transmitted, but nothing more happens. I can see that the Service request is pending in the NVIC (ExtIRQ 91).

What do I need to do so that the DMA writes the rest of the data to the USIC?
0 Likes
2 Replies
User8819
Level 4
Level 4
Hi,

I would first disable FIFO and use just TX buffer, set HW handshake for DMA, first write to TBUF by SW manually and continuation will be by HW until length programed in CTLH_BLOCK_TS.
Check again all your settings in registers, also SRSEL0...

I do also this
// this will reset pending last request from previous transmission
DLR->LNEN &= ~((uint32_t)(DLR_LNEN_LN7_Msk));
DLR->LNEN |= ((uint32_t)(DLR_LNEN_LN7_Msk));


rum
0 Likes
User10696
Level 4
Level 4
First solution authored
I have managed to solve the problem.
I had the USIC interrupt set to "transmit buffer interrupt", this does not work. I have now changed to using the "transmit shift interrupt" and now it works as expected.

I am not quite sure why the buffer interrupt does not work. Does anyone have an idea?
0 Likes