UART transmit with DMA

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

cross mob
User8819
Level 4
Level 4
Hi everyone,

I want to use UART and DMA. The code should send out of UART some characters contained in a buffer using DMA. After reading many docs about UART and DMA, after fighting with DAVE examples and code, I was not successful. I believe that my code could be 99% correct because some chars are coming out but not as I want.
If I send buffer contained (0,1,2,3,4,5,6,7,8,9) only 3, 7 , 9 appear on serial output!
Can someone share code or provide assistance what should be the right configuration.
I want to accomplish following.
1. Use USIC0, all configuration
2. Use SR1 when Transmit buffer event occurs, and route this line to DLR of DMA
3. DMA configuration
4. Use DMA 0 channel 7
5. Select DLR line 7
6. Start transfer of fixed number of bytes

What are the diagnostic steps I can take to understand what is happening?
Thanks
0 Likes
3 Replies
Not applicable
Hi rum,

Looks to me that it could be mismatch in term of data size.
It seems the data transferred by DMA is in 32bit but the USIC could only transmit 8bit..
For UART, usually the word length is set to 8bit, so only 8-bit data will be transmitted out.
So in this case, it seems you are loading 32-bit of data into the TBUF and of course, only 8-bit get transmitted and other data gets truncated.

rdgs,
Rou
0 Likes
User8819
Level 4
Level 4
Thanks Rou for trying. But width of transfers is governed by settings of CTLL register bifields SRC_TR_WIDTH, DST_TR_WIDTH. Register default value is 00304801h which means that these fieds are zero, corresponding to 8bit transfer, verified also with debugger.

Any other sugestions? Rgds rum.
0 Likes
Not applicable
Hi rum,

Have you check out this thread?
UART and GPDMA
0 Likes