cancel
Showing results for 
Search instead for 
Did you mean: 

Uart rx: whats the best solution Receive unkown size of message

mmed
Associate III

using HAL or LL libraries, its mandatory to set the size message in the receive function. I want to receive messaege with undefined size. whats the best way to implment it! help please.

2 REPLIES 2

Each byte reception generates an interrupt, you process byte that into a buffer in a stateful fashion, when you have a complete packet, or line, or however you delineate content, you pass that off to a worker task to process/digest. If you don't like interrupts, have a circular DMA buffer, with adequate size for your sweep frequency, and have a worker task pull the data for processing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..