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
  • If you don't update the RXD.PTR before the next STARTRX task is called it will start writing to the same location. Use shortcut between ENDRX and STARTRX to keep the UARTE always in reception.

    Seems like figured out a way to count the data. Just remember that the data may not be written to RAM when the RXDRDY event triggers:

    For each byte received over the RXD line, an RXDRDY event will be generated. This event is likely to occur before the corresponding data has been transferred to Data RAM.

    You can also read the RXD.AMOUNT register to see how many new bytes have been transferred to the RX buffer in RAM since the last ENDRX event.

Reply
  • If you don't update the RXD.PTR before the next STARTRX task is called it will start writing to the same location. Use shortcut between ENDRX and STARTRX to keep the UARTE always in reception.

    Seems like figured out a way to count the data. Just remember that the data may not be written to RAM when the RXDRDY event triggers:

    For each byte received over the RXD line, an RXDRDY event will be generated. This event is likely to occur before the corresponding data has been transferred to Data RAM.

    You can also read the RXD.AMOUNT register to see how many new bytes have been transferred to the RX buffer in RAM since the last ENDRX event.

Children
No Data
Related