2023-04-26 01:39 AM
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!
2023-04-26 01:59 PM
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.
2023-04-26 02:24 PM
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.
2023-05-04 01:42 AM
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!