Skip to main content
Visitor II
November 27, 2025
Question

USB CDC device not recognized

  • November 27, 2025
  • 3 replies
  • 304 views

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




    This topic has been closed for replies.

    3 replies

    Technical Moderator
    November 27, 2025

    Hi @Sandman2 

    Is your device bus powered?

    Here is a reference design example :

    FBL_0-1764245511944.png

     

    Sandman2Author
    Visitor II
    November 27, 2025

    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.

    Super User
    November 27, 2025

    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.

    Sandman2Author
    Visitor II
    November 27, 2025
    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?
    Super User
    November 27, 2025

    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.

    Graduate
    November 27, 2025

    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.