cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446RE USB Baudrate

werwolv98
Associate II
Posted on November 20, 2016 at 14:26

Hi

I'm currently working on a project in which I use the USB_OTG_FS interface with the VCP USB class to transfer data back and fourth from the uC and the Computer. I managed to setup everything so the computer sees my device but I cannot get the data because I don't know which baud rate the uC uses. Is there any way to change the baud rate on the uC?

I'm using a 8MHz external quarz oscillator and would like to use 115200 baud for transfer.

#!stm32-!vcp-!/dev
4 REPLIES 4
Posted on November 20, 2016 at 15:36

At the VCP level it should be fairly agnostic. On things like the ST-LINK the VCP is attached to a physical USART, which in turn constrains that interface.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
werwolv98
Associate II
Posted on November 20, 2016 at 16:35

So I have to enable the USART interface in order to send something and change the baud rate?

filips92
Associate
Posted on November 20, 2016 at 23:20

Hello,

no, the USART have nothing to do with it. The baudrate you set in the terminal of USB VCP is irrelevant to the USB transmission. Have you tried sending a character in a loop from the microcontroller to you USB port? Just use the send function from file usbd_cdc_if.c .

Posted on November 21, 2016 at 00:59

The VCP is ''virtual'', if you stay in the virtual domain the interface doesn't care what you pretend to do about the baud rate, you respond to, but ignore any setting or change. Where you need to stop ignoring the setting is where you output the data to something that physically exists like a USART, where you are taking data via a VCP connection and stuffing into a real interface that you want to configure from the PC end.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..