AnsweredAssumed Answered

Retriggering Configured DMA for USART Tx

Question asked by hon.bo_xuan on Jan 19, 2014
Latest reply on Jan 23, 2014 by hon.bo_xuan
Hello all,

I have written a function to configure the DMA for use with one of the USARTs for TX, which works when I trigger it using DMA_Cmd() function. As with the usual USART DMA configurations, all it does is transfer some bytes from a buffer in memory to the appropriate USART. Specifically, I'm using DMA_Mode_Normal instead of "DMA_Mode_Circular" so the transfer stops without having a use the transfer complete interrupt (no interrupts currently).

My intention, however, is to have the CPU perform some calculations, write the result (of fixed size) to the buffer, trigger the DMA transfer, and loop back to the calculations while the DMA does its work.

So far, I seem to only be able to achieve this by reconfiguring the DMA (DeInit, Init) and calling DMA_Cmd. I initially thought setting the NDTR value to the size of the buffer was the key, but that did not work. I am sure there is a better way to achieve this, where it is not necessary to reconfigure the DMA.

Any help will be appreciated. Thank you in advance!

Hon

Outcomes