STM32F030 UART transmit DMA circular mode won't stop transmitting
Hello
I'm using the latest HAL library for STM32F030. I've set up a 512 byte transmit buffer for holding bytes that are to be transmitted out the UART using DMA in circular mode. The goal is to treat this 512 byte buffer as a circular transmit queue using queue head and queue tail variables as indexes into the buffer. The qhead index controls where characters to be transmitted are to be inserted into the 512 byte buffer by my firmware. The qtail index is used to control the start address for where the DMA is supposed to transmitting from. As bytes are added into the transmit buffer, my firmware manages wrapping the data from the end of the buffer back to the beginning of the buffer. Then, using the UART transmit DMA in DMA_CIRCULAR mode, the goal would be to have the DMA perform a similar process - automatically wrapping from end of buffer back to the beginning of the buffer to finish the transmission when necessary. For the very first transmit, when I select DMA_NORMAL mode, everything works as expected - 21 bytes are transmitted as expected. If I change one line of code to run the DMA in DMA_CIRCULAR mode, those same 21 bytes are repeatedly transmitted by the DMA. Any Ideas as to what I can try to make the DMA stop after those 21 bytes are transmitted - so the next block of bytes can be transmitted? Should the UART transmit DMA running in DMA_CIRCULAR mode work as I described above? If not, please explain why. I'm calling HAL_UART_Transmit_DMA() to start the transmission process
Note that I already have this working for the UART receive DMA operating in DMA_CIRCULAR mode. For reception, I'm using HAL_UARTEx_ReceiveToIdle_DMA()
