cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411CEU6 "Black Pill" USB virtual COM port code not working, but working on STM32F4 discovery

Gbeau.1
Associate

Hello,

I'm using STMCubeIDE, with firmware version: STM32Cube FW_F4 V1.25.0

I am trying to implement a USB virtual COM port. My code is working on the STM32F4 discovery board. I then created a new project for the STM32F411CEU6 "Black Pill", but the USB device will not enumerate. Error message in windows is "Device Descriptor Request Failed"

For the project, I select "Device Only" for USB_OTG_FS, and in the USB_DEVICE middleware, I select "Communication Device Class (Virtual Port Com). The only other change I made to the generated code was to usb_cdc_if.c file to add the lineCoding.

I've attached my clock configuration screenshot.

Has anyone tried to implement a USB device on one of these black pills? If so, would you know if I'm making any obvious error with what I'm trying to do?

Thank you very much,

Garrett.

1 ACCEPTED SOLUTION

Accepted Solutions
Gbeau.1
Associate

Hello Everyone,

I hope it's not bad etiquette to respond to my own question, but I believe I may have found out my issue. I am using a hub to connect to, and this hub works for the STM32discovery board but not the black pill. It's strange but if I do not go through the hub (i.e. directly to a USB port on the computer) then there is no issue. I wonder if It is a power supply issue? Maybe from the hub the black pill does not have stable power before it tries to enumerate. I'm just guessing.

I am OK with plugging into the computer, so I think I'm all good.

Thank you very much,

Garrett.

View solution in original post

1 REPLY 1
Gbeau.1
Associate

Hello Everyone,

I hope it's not bad etiquette to respond to my own question, but I believe I may have found out my issue. I am using a hub to connect to, and this hub works for the STM32discovery board but not the black pill. It's strange but if I do not go through the hub (i.e. directly to a USB port on the computer) then there is no issue. I wonder if It is a power supply issue? Maybe from the hub the black pill does not have stable power before it tries to enumerate. I'm just guessing.

I am OK with plugging into the computer, so I think I'm all good.

Thank you very much,

Garrett.