Question
USB CDC CubeMX getting started
Posted on August 07, 2015 at 15:47
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