XMC4800 UART in DMA mode

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

cross mob
User7921
Level 3
Level 3
Hi,

I'm facing a problem when using the DAVE app (4.1.2) to send data over UART by using DMA mode.
In all my other project I did use the FIFO mode, but now I need to do it by using DMA.

The problem is that when using standard app functions, the first character is always missing.

The test is very simple:

uint8_t Send_Data[] = "Infineon";
UART_Transmit(&UART_0, Send_Data, sizeof(Send_Data)-1);


But only "nfineon" can be seen on the TX pin. I checked it with a Logic Analyzer.
As I'm using an APP's function, I guess the DMA transfer is being set up correctly by the app to avoid
unaligned access.

What can I have made wrong in these two lines of code?

Any idea is appreciated.

Michael
0 Likes
3 Replies
User7921
Level 3
Level 3
Comment:

It seems that the problem only occurs when RX mode is set to DMA, too.

I had TX & RX set to DMA => First byte is missing
I switched TX to Interrupt => OK
I switched TX back to DMA => First byte is missing
I switched RX to Direct => OK

As far as I know, two DMA channels can be used per USIC module.
My SPI interface, which also uses DMA for TX & RX, is located at a different USIC.

Michael
0 Likes
chismo
Employee
Employee
First like received
Hello Michael,

I tried this on an XMC4800 relax kit but I do not see the missing byte on Docklight.

Basically I did the following:
1) created new DAVE CE project
2) added v4.1.2 UART app
3) selected protocol handling to be DMA for both Tx and Rx
4) selected the UART pins and DMA channels via the manual pin/resource assignment options
5) added the 2 lines of code into main.c

Is the above the same setup that you have?
Or is it possible to share your DAVE project?

Regards,
Min Wei
0 Likes
User7921
Level 3
Level 3
Hi Min Wei,

exact one hour ago I found the problem 😄

This new project is based on the KEIL RTOS.
When I started on this project, the first thing I did was to code a debugging interface over UART and I used the KEIL CMSIS USART module in µVision.
Although the manual talks about DMA access, only FIFO mode is possible in this implementation and I used it in FIFO mode.
Then I started on the SPI master interface of my project and I discovered that the KEIL CMSIS SPI master implementation is very slow on the line.
I decided to go back to the Infineon implementations, which I always used without any issues in speed and functionality in other projects.
So I coded also my Modbus interface with use of the Infineon stuff and I totally forgot about my debugging interface implementation...
So both implementations were used. Modbus on one UART port with DMA and the debugging interface with FIFO on a different UART port.
This caused the missing leading byte. No idea why.
This morning I also got rid of the CMSIS UART stuff and went to Infineon for the debugging interface, as well.
No problem any more. No matter if DMA or FIFO mode (or mixed) is used.

So the KEIL UART stuff seems to influence my Modbus implementation, although the UART from the Modbus interface was not configured to be used in KEIL µVision.

So thank you for the effort on trying to reproduce my problem and sorry that it was in vain.

Best Regards
Michael
0 Likes