cancel
Showing results for 
Search instead for 
Did you mean: 

quick usb question

John Doe1
Associate III
Posted on March 05, 2017 at 12:01

In simply words:

I want to transfer data from PC via USB to STM32.

I want to (somehow?) recognize data - some data should be saved to uint8_t Data1[20], and other data to uint8_t Data2[20].

My question is:

- should I create two different VCP/CDC interfaces on stm32?

or

-should I create one VCP/CDC interface with multiple endpoints?

how to recognize data to put them in the correct uint8_t Data1/Data2 array?

#questions #stm32-vcp #usb-cdc #usb
1 REPLY 1
S.Ma
Principal
Posted on March 05, 2017 at 12:37

A short term implementation would be to use the baudrate control which has no meaning if talking to STM32 only.

Each baudrate control goes to a switch/case in the USB driver and could be used as a data flow mux, allowing more scalability.

Another way would be to implement the typical 'AT Command set' scheme used by connectivity modules

Or send 2 bytes per user data byte. The first byte being the mux index (1 or 2). This would work reversably too at the expense of a slower average bit rate.

Or dual VCP composite device (which I haven't experimented yet...) I guess having 2 COM ports would enable 2 teratem console to work seamlessly on the PC side?

I was told that 1 COM = 2 EP IN + 1 EP OUT. If no handshake needed = 1 EP IN + 1 EP OUT.