This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UARTE in circular mode

Hi,

I have a question about the UARTE peripheral. is it possible to keep the DMA running and let it write to ram in a circular way? I used DMA on the stm32 before and there we can set it in a circular mode. When the ptr reached the last configured ram address it automatically starts from the front. And while the DMA is running, is there any way to get the current amount in the buffer? Now i have to stop rx before the amount register becomes valid.

Parents
  • You can stop the uart (STOPRX), wait for the RXTO event, flush the FIFO, wait for the ENDRX event and then read the number of bytes written to RAM (AMOUNT). The time between STOPRX and RXTO event is long enough to get 59 bits/bauds on the bus, f.ex. with 250K baudrate it will take 236us.

    I don't understand the problem with using a timer, you have 6 timers available and I would say only the UART peripheral is built in such way that it may need some "hacking".

Reply
  • You can stop the uart (STOPRX), wait for the RXTO event, flush the FIFO, wait for the ENDRX event and then read the number of bytes written to RAM (AMOUNT). The time between STOPRX and RXTO event is long enough to get 59 bits/bauds on the bus, f.ex. with 250K baudrate it will take 236us.

    I don't understand the problem with using a timer, you have 6 timers available and I would say only the UART peripheral is built in such way that it may need some "hacking".

Children
No Data
Related