cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx CubeMX USB device CDC class example

krubow
Associate II
Posted on September 26, 2014 at 02:00

I am using an STM32F427 processor and wish to implement a USB device CDC virtual serial port on the HS USB port. I am generating my initialization/driver code with CubeMX. I am having a hard time figuring out what needs to be implemented in the usbd_cdc_if.c file to get buffered full duplex data transfer. I do not want a USB/USART bridge, just communication via a virtual serial port to the embedded application.

Any CubeMX generated examples projects out there? I use the USB HS because the FS is preempted by the USART1 RTS/CTS pins. I need flow control to work in both directions, and would also like to know when the virtual COM port is opened or closed on the PC end. Is this done through CDC_Control_HS, or by monitoring the device status is some other way?

There doesn't seem to be any written documentation on the USB device driver, or maybe there is but I don't know where to find it?

10 REPLIES 10
ilya2
Associate
Posted on January 14, 2016 at 09:49

I have a very similar issue with a duplicated USB data sent in a following frame.

This happens only on certain computers. The information sent from a PC USB via Virtual Com Port to the STM32 device which uses ST provided USB libraries. Using Beagle USB analyser managed to capture a trace which showed the duplicated data in one of the frames. Each frame contains 63 bytes of data. I can provide a trace from the USB analyser that shows two consecutive frames with duplicated data. It is not a repeat as both frames were successfully received and ACKed by STM32 software and have DATA0 and DATA1 flags in them.

Keith, I would be interested to know what was the resolution of this thread?

GI