Some Pointers Needed: How to Stream Incoming Data from UART into USB Host MSC?
I am trying to implement a feature to log real time measurement data which comes in to MCU via UART peripheral and them write it into file system to USB stick.
Assume I already have a dedicated task call ReceiverTask which is responsible to receive the measurement data. Then another task called USBTask which is responsible to handle file write/read operation. I want this stream of data from UART written into a file for given period of time and stored in USB.
The only idea that I have is for ReceiverTask to notify USBTask of the request via a queue, and also pass the data buffer once it is full. The USBTask then open and write the buffer to file. Then clear the buffer again and redo the process till the time period expired and finally USBTask close the file. But I am not sure, I believe there should be better approach than this.
Is it possible actually for USBTask once notified of logging request just take the stream data directly from UART peripheral? Without relying on ReceiverTask to acquire the data - just a thought.
Thank you for the patience to read this.
