Hello, I am trying to implement USB CDC on the ST32F4 discovery board, and I am running into issues. I generate the project using the STM32CUBEMX software, which theoretically includes all the usbd middlewares. I had an initial problem where when connecting the usb, windows would give me error 10, but I fixed that by changing all the maxpacketsize variables to 64 per another post. My current problem is that the board can only successfully receive 1 character over the serial terminal, every other one sent from the pc results in a "cancelled" according to the usb sniffer I have installed. I have tried a lot of different things and searched the forum, but I can't seem to find anyone who has my exact problem. There also seems to be a mixing of ST usb code and Keil usb code, which doesn't help the situation. A screenshot of the sniffer is available at: http://imgur.com/47m2SXc . I would post code but I'm not quite sure what part(s) to post. Any help would be appreciated.
Also, while debugging I notice the first time I send a character from the PC it triggers an interrupt on the microcontroller, which is cleared by the stock firmware. However, after that instance it never enters the interrupt again regardless of the number of times the pc sends more characters. All the descriptors seem to match ST's Virtual COM Port requirements as well.
It sounds like you are intermixing ST and Keil code and it is probably the source of your problem. Keil has VirtualCOM example for their board MCBSTM32F400 which you can take a look as a reference or you can stick with ST code, anyways if you are intermixing code you have to know exactly what you are doing.
I started the code over and now it's only Keil code. I managed to get it connected to windows, but once again the micro only accepts one packet, then never goes back into the interrupt subroutine. I have compared my code to other Keil reference codes and the descriptors are identical.
Which versions of MDK, Middleware and ST pack are you using?