cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer data coming from different devices

LOnGr.1
Associate III

Hi ! I am receiving data from two devices and want to transmit it using usb. I am able to send using usb when receiving (to a circular buffer) only from one at a time but when I receive from both, it doesnt work (a lot of data is lost and I cannot differentiate which data is coming from which device). Do you guys have any ideas how to manage the reception and transmission when both uarts are active? Thank you!

3 REPLIES 3
Karl Yamashita
Lead II

You haven't shown any code so we don't know how you're buffering the data?

You can see this post where I am using two instances of a UART buffer.

https://community.st.com/s/question/0D53W00002EsvCOSAZ/how-best-to-bufferreceive-this-uart-data

Since you know which UART instance you're parsing, you can then package that information with some kind of header which indicates which UART sent the data and transmit the packet over USB.

If you find my answers useful, click the accept button so that way others can see the solution.

How would one normally convey that data's coming from a different source?

Could you use a CDC/VCP implementation with multiple logical units, like a DUAL or QUAD UART. Probably not enough end-points for the latter, but presumably you could describe via the DESCRIPTORS?

Or emulate some CMUX implementation, where you encapsulate the content and have host side code in your application to DEMUX the sources.

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

Thank you for replying, I was looking on the internet to understand your suggestion but didn't find a good explanation. Can you please explane what to you mean by use a CDC implementation with multiple logical units? or emulate some CMUX implementation? Thank you!