cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC device not recognized

Sandman2
Associate II

Hello everyone. 

I am using an F411 and I cannot figure out how this is supposed to work. 

I enabled USB_Device in middleware, enabled USB_OTG_FS, and set up line encodings based on the default STM32 example, but when I flash STM (or step through with the debugger) I run into an error during the initialization that says "The last USB device you connected to this computer malfunctioned, and Windows does not recognize it." Apparently this means I am not enumerating.

I went through other posts on this forum. I made sure interrupts were enabled, that the clock is exactly 48 Hz, and I allocated extra space on the heap and the stack. 

Sandman2_0-1764225519675.png

Here is a picture of my clock.

Sandman2_1-1764225567364.png

Here is my USB schematic. 

What does this mean? How can I even go about fixing this?

Thanks




6 REPLIES 6
FBL
ST Employee

Hi @Sandman2 

Is your device bus powered?

Here is a reference design example :

FBL_0-1764245511944.png

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Sandman2_0-1764254740243.png

Yes, I am powering my STM through the same USB connection I'd like to write data out of. I know this is correlated with VBus, but the actual Vbus pin on PA9 isn't connected on my physical PCB so I didn't think I needed it.

TDK
Super User

Short BOOT0 to VDD and reset the chip. Is the USB DFU bootloader recognized? If so, hardware is fine and the problem is in software. Try getting an example project up and running.

If you feel a post has answered your question, please click "Accept as Solution".
I don’t have access to my hardware tools right now. Is there a way to
assess this in software? Is there something obvious I am missing?
gbm
Principal

Yes, you are missing one obvious thing: at least according to the schematic there is no connection between the USB-C connector data lines and MCU's USB data lines.

Also, if you use breakpoints and single-stepping during USB enumeration, the enumeration process will fail.

You don't need VBUS sensing but if not connected, it must be disabled in USB peripheral settings.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

I don't see how you can debug hardware without access to that hardware.

Schematic is fine, should work, but clearly something is wrong. That is one way to start the debugging process to identify the issue.

If you feel a post has answered your question, please click "Accept as Solution".