AnsweredAssumed Answered

STM32F0 VCP with Cube-generated code?

Question asked by simon.elias on Oct 10, 2014
Latest reply on Jan 12, 2016 by STM32Cube-T
Branched to a new discussion
First off, I'm relatively new to microcontroller programming, so please bear with me here.

I'm trying to get two-way communication going over a VCP between a device that has an STM32F042 MCU and PuTTY. I've generated code with STMCubeMX, with the USB CDC stuff enabled, as well as several other peripherals.

I'm trying to get reception on the device working, but it seems to only receive one packet after a reset. I run the program on the device, open the COM port with PuTTY, hit a key on the keyboard, and the LED that I've set to toggle under CDC_Receive_FS() toggles, and then never again after more keystrokes.

I've noticed that USB_IRQHandler() only gets hit that first time. If I set a breakpoint in the function before I make the first keystroke, the breakpoint gets hit, but if I set it after the first one (so as not to interrupt USB communcation), it never gets hit again.

I suspect that there's some pointer I need to increment that magically re-enables the interrupt, but I'm really unsure. I've attached what I think is the main file that the user is supposed to modify for packet reception/transmission. All my main function does is run the Cube-generated initialization code, and then go into an infinite empty loop.

Thanks in advance!