AnsweredAssumed Answered

CubeMX - USB Virtual COM Port sends only first word

Question asked by sinitsin.artyom on Apr 3, 2015
Latest reply on Aug 10, 2017 by solovei.vladisla.001
What happens? I've created project in CubeMX, there - CDC virtual com port. So, this is function CDC_Transmit_FS() in usbd_cdc_if.c
uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
  uint8_t result = USBD_OK;
  /* USER CODE BEGIN 7 */
  USBD_CDC_SetTxBuffer(hUsbDevice_0, Buf, Len);  
  result = USBD_CDC_TransmitPacket(hUsbDevice_0);
  /* USER CODE END 7 */
  return result;
}

So, I have button interrupt in main.c
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
    HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_12);
   
    CDC_Transmit_FS("Hello",5);
    for (int i = 0 ; i <1000000; i++);
    CDC_Transmit_FS("World",5);
}
What happened when I press on button:
Serial port COM22 opened
Hello
Second word does not send! Why?
Board STM32F4discovery, CubeMX 4.7, Firmware package 1.5.0 - the latest for today.

Outcomes