2015-04-27 12:04 PM
Can someone show me a working example program of STM32F4 USB virtual com port using the STM32cubeF4 library?
2015-04-28 01:44 AM
USBD_HandleTypeDef hUSBDDevice;
int main(void) { HAL_Init(); SystemClock_Config(); /* Init Device Library */ while(USBD_Init(&hUSBDDevice, &VCP_Desc, 0) != 0) {} /* Add Supported Class */ USBD_RegisterClass(&hUSBDDevice, &USBD_CDC); /* Add CDC Interface Class */ USBD_CDC_RegisterInterface(&hUSBDDevice, &USBD_CDC_fops); /* Start Device Process */ USBD_Start(&hUSBDDevice); data = ..... while(1) { USBD_CDC_SetTxBuffer(&hUSBDDevice, &data[0], 8); USBD_CDC_TransmitPacket(&hUSBDDevice); } }2015-04-30 02:24 AM
Hi Lee,
Look at ''STM32Cube_FW_F4_V1.5.0\Projects\STM324x9I_EVAL\Applications\USB_Device\CDC_Standalone'' for example.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.