cancel
Showing results for 
Search instead for 
Did you mean: 

USB baud rate

Moamen Ayman
Associate III
Posted on December 15, 2016 at 14:11

Hello, I'm trying to work with USB FS mode embedded in stm32f407vgt6 as device connected to PC(host), the reference manual says FS mode supports 12MHz speed and it's mentioned in the notes of CDC library (version 1.2) that '

Note: In your terminal are options to set baudrate, stop bits, etc. Leave that at it is, these settings don’t care, because everything is configured by USB.

' I don't understand this statement, does that mean it will work directly on full speed which is 12MHz because I don't find function in CDC library to set the baud rate, I do want to work on this maximum speed but how can I configure the speed?  

Thanks in advance! 

2 REPLIES 2
shingadaddy
Senior
Posted on December 15, 2016 at 16:05

' how can I configure the speed?  '

Down the USB wires - I don't believe you do... I think of it this way.

On a USB 2.0 FS(Full Speed) capable implementation, the data on the USB wires is ---12Mbps ---. No matter WHAT the com port setting are. That's FS speed on the USB wires.  Now more in depth - those COM PORT settings are generally to do with a VIRTUAL COM PORT that gets configured when you plug in a USB device that enumerates and installs as a VIRTUAL COM PORT ( Like a USB to RS232 converter). THAT type of device at the RS232 side has - surprise - A UART!

Those com port settings are pushed to THAT uart during a control endpoint communication during USB device setup.

Now lets say you have a device that is NOT a USB to RS232 converter. (Presumably something like YOU have). You may have a USB controlled LED blinker... And you just want to get data from the PC to your device. And you lean on your COM PORT knowledge and see this VCP capability. Well since your END DEVICE is not using a UART but can make use of the VCP style connection and data transfer, then - the com port setting don't matter... You still get the USB transferred data. Data transfer emulation is somewhat emulated with either full packet detection or timeouts. IF a USB TX buffer has a full load in it, it gets transmitted NOW if the receiver isn't nacking it. (Flow control emulations) OR if a TX buffer has say - 1 byte in it and a timeout occurs (1ms maybe) the USB transmitter fires the byte down the usb wires.

Needless to say - A LOT going on behind the scenes. That's a rough idea. And I could be wrong. And things vary.

USB - Be prepared to learn a LOT.

Posted on December 17, 2016 at 11:51

Thanks

Palmer.Randall

I'm trying to implement an isochronous data transfer between PC and STM32f4 UC, I will perform the experiment using the available CDC library and see the result!