2016-11-20 05:26 AM
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-!/dev2016-11-20 06:36 AM
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.
2016-11-20 07:35 AM
So I have to enable the USART interface in order to send something and change the baud rate?
2016-11-20 02:20 PM
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 .2016-11-20 03:59 PM
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.