AnsweredAssumed Answered

USART DMA transmission

Question asked by Philippe on Aug 20, 2015
i'm using the HAL library and CubeMx. The chip is a STM32F334C8.
I want to send datas on USART1 with DMA control. The datas are well sent but when i go to the DMA complete transfer interrupt, i wait in the interrupt for the effective transfert of the 2 last bytes.
In fact when the DMA transfert is complete, the usart transmitter register is sending a byte and the usart buffer register contains the last byte transfered by DMA control. So 2 bytes have to be sent when the DMA complete transfert interrupt occurs. If the baud rate is 9600, i have to wait 2ms in the interrupt !!!
The function UART_DMATransmitCplt( ) called in the interrupt waits for the transmit to be complete by testing the USART1 Ttrasnmitt Complete flag.
For the moment, i'm not going to use DMA. But this particularity is really annoying for me.
I know that i can manually modify the source files so it will be my last solution.