Question
CubeMX - USB Virtual COM Port sends only first word
Posted on April 03, 2015 at 16:50
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.
#cdc #stm32 #stm32f4 #usb #vc