Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

EasyDMA with UARTE and receiving variable sized messages

Hi I'm porting an existing project from nrf51 to nrf52810 and trying to configure the UARTE EasyDMA to handle serial reception.

We have serial messages of variable length (between 2 and 18 bytes) being sent from a separate microcontroller to the nrf52, all with a null terminator on the end of each message.

Assuming I assign it a buffer large enough to receive the largest message possible, is there any way to trigger or detect an end of message from the null character received, or even from a timeout or something?

Is there any way to get an interrupt on each character received into the dma ram so I could check it for null and change the dma to point to a new buffer for the next message?

Thanks.

Parents
  • Hi,

    Assuming I assign it a buffer large enough to receive the largest message possible, is there any way to trigger or detect an end of message from the null character received, or even from a timeout or something?

    Unfortunately not.

     

    Is there any way to get an interrupt on each character received into the dma ram so I could check it for null and change the dma to point to a new buffer for the next message?

    As you can see in this documentation, you will get an RXDRDY event (that can trigger an interrupt) on every received byte. I suppose you can use this to check each received byte and change the pointer to the buffer accordingly, but then some of the point of EasyDMA is gone. 

Reply
  • Hi,

    Assuming I assign it a buffer large enough to receive the largest message possible, is there any way to trigger or detect an end of message from the null character received, or even from a timeout or something?

    Unfortunately not.

     

    Is there any way to get an interrupt on each character received into the dma ram so I could check it for null and change the dma to point to a new buffer for the next message?

    As you can see in this documentation, you will get an RXDRDY event (that can trigger an interrupt) on every received byte. I suppose you can use this to check each received byte and change the pointer to the buffer accordingly, but then some of the point of EasyDMA is gone. 

Children
No Data
Related