2023-01-23 12:17 AM
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
Solved! Go to Solution.
2023-01-26 10:19 AM
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!
2023-01-23 02:32 AM
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
2023-01-23 08:09 AM
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
2023-01-25 04:33 AM
Hi @Community member
Could you try same setup, but just disable use of the Fifo ? And check if you observe same results
Regards
2023-01-26 01:55 AM
Hi @Guenael Cadier
Thank you very much!
Disabling the FIFO loses always the 2nd character - same as setting FIFO threshold to 1
Regards
2023-01-26 02:12 AM
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
2023-01-26 10:19 AM
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!