AnsweredAssumed Answered

USB CDC CubeMX getting started

Question asked by scholle.steffen on Aug 7, 2015
Latest reply on Aug 11, 2015 by scholle.steffen
Hello friends,

I try to create a simple program, which uses a Virtual COM Port to send and receive data. As hardware I'm using a stm32f3discovery board.

I already created the code with CubeMX and the devices shows up as Virtual COM in the device manager.

Now I'm trying to use the functions placed in usbd_cdc_if.c

I now, that I need to set the Buffer with data and then transmit.
mybuff[0] = 'A';
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, &mybuff[0], 8);
CDC_Transmit(mybuff[],1);


But, as soon as I'm using the SetTxBuffer function in main, the Virtual COM disappears and the program seems to stop working.

The question is: How can I simply realize send and receive data via the virtual COM? Are there any examples?

Thanks in advance

Outcomes