Skip to main content
LOnGr.1
Associate III
April 26, 2023
Question

Transfer data coming from different devices

  • April 26, 2023
  • 3 replies
  • 1304 views

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!

This topic has been closed for replies.

3 replies

Karl Yamashita
Principal
April 26, 2023

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 a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
Tesla DeLorean
Guru
April 26, 2023

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
LOnGr.1
LOnGr.1Author
Associate III
May 4, 2023

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!