cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 UART DMA problem I use DMA to transmit data via USART1 using DMA. Every beginning of transmission shows that 10th character is dropped, everything else looks fine even for large data blocks.

nmiljevic2
Associate II

Using HAL_UART_Transmit_DMA

USART is in async mode, 115200,8,1,-

DMA:

Data width = byte (nothing else works)

Any clues as to what could be happening here?

Thank you!

Ned

1 ACCEPTED SOLUTION

Accepted Solutions
nmiljevic2
Associate II

Hello Guenael Cadier ,

thank you for your help, you have put me on the right track (to revisit the interrupt function) - the error was entirely mine as I had an error in the receiver interrupt routine. Now everything works well - in a hurry I echoed the received character by wrtitng into TDR directly instead of enqueueing it.

It pays to read the code more than twice 🙂

Once again, thank you very much!

View solution in original post

6 REPLIES 6
Guenael Cadier
ST Employee

Hi @Community member​ 

No idea about what could happen.

Which STM32 device are you using (to try to find you a working example on DMA transmit) ?

Could you share some parts of your code (UART and DMA init, HAL_UART_Transmit_DMA calls, ...) ?

How do you detect the 10th byte is missing ? (Receiver on the other side ?)

Or is it confirmed by a logic analyzer spying the UART TX line ?

I guess you already have properly enabled the UART IRQ (used for completing the UART transmit process and call TxComplete callback).

Regards

nmiljevic2
Associate II

Hello @Guenael Cadier (ST Employee)

Thank you for your answer.

I'm using Nucleo-U575ZI-Q board and STM32CubeIDE. All files have been generated from .ioc using HAL calls.

I've become a little smarter playing around and have seen that the character gets dropped consistently and it is dependent on txfifo srettings. The character after the threshold gets dropped but only at the beginning of transmission.

I'm quite puzzled here....

Thank you!

Regards

Hi @Community member​ 

Could you try same setup, but just disable use of the Fifo ? And check if you observe same results

Regards

nmiljevic
Associate

Hi @Guenael Cadier

Thank you very much!

Disabling the FIFO loses always the 2nd character - same as setting FIFO threshold to 1

Regards

Hi @Community member​ 

No obvious idea on my side ...

In STM32CubeU5 firmware package, you should be able to find a UART example using DMA communication in following folder :

Also available on Github here

This example is designed to be executed between 2 Nucleo boards, but, if you take only the project with TRANSMITTER_BOARD flag enabled, and connect it to a PC Hyperterminal for instance, you should be able to see the transmission from U575.

If this example works, you will be able to compare your DMA and UART configuration, maybe ...

Regards

nmiljevic2
Associate II

Hello Guenael Cadier ,

thank you for your help, you have put me on the right track (to revisit the interrupt function) - the error was entirely mine as I had an error in the receiver interrupt routine. Now everything works well - in a hurry I echoed the received character by wrtitng into TDR directly instead of enqueueing it.

It pays to read the code more than twice 🙂

Once again, thank you very much!