Electronic – STM32 Virtual COM port baud rate

stm32stm32f4usb

I'm using the STM32 VCP firmware and I want to transmit data to my PC from STM32F4 discovery board.
The configuration of the virtual COM port is fine, the properties are the following in device manager:

VCP configurations

In english: 9600 bit/s, 8 data bit, no parity, 1 stop bit, no hardware flow control.
I'm trying to receive characters in Realterm with these parameters, but I don't get them, it looks like following:

Realterm screenshot

What could I do wrong?

EDIT:

The MCU sends with the following code snippet:

int main(void)
{
  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  MX_USB_DEVICE_Init();
  uint8_t Buf[] = "test";
  HAL_Delay(1000);
  while (1)
  {
      CDC_Transmit_FS(Buf, 4);
      HAL_Delay(1000);
  }
}

Best Answer

The CDC_Transmit_FS implementation is buggy (at least in the version I am looking at):

uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
  uint8_t result = USBD_OK;
  /* USER CODE BEGIN 8 */
  USBD_CDC_SetTxBuffer(hUsbDevice_0, UserTxBufferFS, Len);  
  result = USBD_CDC_TransmitPacket(hUsbDevice_0);
  /* USER CODE END 8 */
  return result;
}

As you can see the Buff parameter is never used in the function. You might try modifying the function, by copying the Buff into UserTxBufferFS (using memcpy or whatever).