2020-03-30 07:20 AM
Hi,
I'm trying to develop a module where information from a buffer is read by DMA and sent through UART, but the information is put in the buffer without a constant rate and it might happen that the buffer is empty, if that happened, I understand that the DMA would keep working sending information which has already been sent.
Then my initial idea is to check whether the buffer has more information in the HAL_UART_TxCpltCallback() and in case that there is no more information disable it, and whenever there's data in the buffer, call HAL_UART_Transmit_DMA.
I've seen HAL_UART_DeInit, but I'm also using the uart RX and then I think both RX and TX would stop working, which is not ok for me.
Then, what do you suggest for tackling this issue?
Best regards,
Nicolas.
Solved! Go to Solution.
2020-04-01 10:05 AM
DFuchs, thanks for your answer.
For any other person with the same issue, the conclusion is that if the DMA is configured in normal mode, the transmission just ends so the user does not have to disable it.
2020-03-30 08:46 AM
Hi,
i can only speak about the STM32H743.
When i'm starting an DMA transfer (memory to peripheral) i set the number of data to transmit (register DMA_SxNDTR). When this register reaches zero i can send the next data.
2020-04-01 10:05 AM
DFuchs, thanks for your answer.
For any other person with the same issue, the conclusion is that if the DMA is configured in normal mode, the transmission just ends so the user does not have to disable it.