2025-08-10 11:51 PM
Hello everyone,
This is my first post here, so if there's anything wrong with the way I've formatted or presented it, please feel free to let me know.
My current task involves switching from USB HOST to USB CDC. I used CubeMX to generate the necessary USB CDC-related files and integrated them into my original program.
On my PC, the program works as expected and is recognized correctly as a COM port.
However, on my coworkers' PCs, the device is not recognized as a COM port.
Both our PC are win11, and after checking, win11 seems no longer requires the installation of the STM Virtual COM Port driver.
Is there anything we can do to further clarify or resolve this issue?
Solved! Go to Solution.
2025-08-27 8:04 PM
Hi All,
After thorough investigation, we found that the issue was caused by insufficient USB power supply.
This explains the inconsistent test results we observed — some computers could detect the device, while others could not.
Final conclusion:
The device works fine when tested under sufficient power conditions, but fails in other environments.
It appears that due to circuit design limitations, even native USB ports on some computers cannot provide enough power. Only externally powered USB hubs are able to meet the device's requirements.
Thank you all for your support and assistance over the past few days.
2025-08-11 2:45 AM
@Andrew_Sung wrote:This is my first post here, so if there's anything wrong with the way I've formatted or presented it, please feel free to let me know.
Welcome to the forum - Check this out: How to write your question to maximize your chances to find a solution.
@Andrew_Sung wrote:On my PC, the program works as expected and is recognized correctly as a COM port.
However, on my coworkers' PCs, the device is not recognized as a COM port.
Is that using the exact same hardware, same cable, etc?
What, exactly, do you mean by, "not recognized as a COM port"?
Does the PC see anything at all?
Does it give any errors?
Is anything shown in Device Manager?
@Andrew_Sung wrote:Both our PC are win11
Are the PCs the same make & model?
There can be issues related to PC hardware; eg,
2025-08-11 3:09 AM
Thank you very much for your response!
Yes, we are using the exact same hardware setup, and we've ruled out the cable and firmware version as potential causes.
When connecting the device to my coworkers' PCs, nothing appears in Device Manager—not even under "Ports (COM & LPT)"—and no error messages are shown. This leads me to believe that the system is not recognizing the device as a COM port at all.
Both PCs are running Windows 11, and they are the same make and model from the same manufacturer, with no additional peripherals connected. So I believe the hardware environment is essentially identical.
Below is a screenshot from my own PC showing the driver information in Device Manager after connecting the USB CDC device:
Also, we have confirmed that this same driver is present on my coworkers' PCs, so the issue does not appear to be caused by a missing driver.
Could there be any other reasons why the device fails to be recognized as a COM port on their systems?
2025-08-12 3:36 AM
Hi @Andrew_Sung
> My current task involves switching from USB HOST to USB CDC.
Could you explain better ? If your task involves switching from host to device, I would recommend this article How to configure STM32 as USB dual role
Regarding the issue you are facing, if you are confident that your STM32 hardware board is correct, try the following:
If none of these steps help, you can capture USB traffic using tools like Wireshark or a dedicated USB analyzer to diagnose the problem further.
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.
2025-08-12 3:42 AM
@FBL wrote:using tools like Wireshark or a dedicated USB analyzer to diagnose the problem further.
Maybe also add diagnostics in the embedded code to see what it's doing; eg, trace outputs to a UART...
2025-08-12 9:25 AM
> a dedicated USB analyzer to diagnose the problem further.
This is the best advice. These things are not that expensive and are often found eBay. I have two Ellisys and one Total Phase. There's one now for $204. All the other USB debugging is blind. Tools are important.
2025-08-12 6:40 PM
Hello @FBL,
Thank you for your sharing! Below is my current configuration:
Our project is currently using the USB host feature, and my task is to add USB device support.
To ensure compatibility with MX, we added our code within the USER CODE sections and enabled HAL_PCD_MODULE_ENABLED via CubeIDE.
We also added two functions to switch between HOST and DEVICE modes.
For USB CDC testing, I created a simple tool to send data over UART and verify the received data, and in my opinion, it works properly.
Additionally, we found that my personal computer (running Windows 10) can correctly recognize the USB CDC device. This makes the situation even more confusing, as I haven’t installed any STM32-related software on that machine.
I will try modifying the PID and use a USB tool to further investigate the issue.
Thank you all for your valuable input and sharing!
2025-08-27 8:04 PM
Hi All,
After thorough investigation, we found that the issue was caused by insufficient USB power supply.
This explains the inconsistent test results we observed — some computers could detect the device, while others could not.
Final conclusion:
The device works fine when tested under sufficient power conditions, but fails in other environments.
It appears that due to circuit design limitations, even native USB ports on some computers cannot provide enough power. Only externally powered USB hubs are able to meet the device's requirements.
Thank you all for your support and assistance over the past few days.
2025-08-28 3:02 AM
Thanks for feeding back on that - definitively one to bookmark!
now that you mention it, I remember that this has come up from time-to-time over the years.
Especially with laptop USB ports.
Out of interest, how did you identify that insufficient power was the problem?
#USBPower #USBFails #USBInsufficientPower
2025-08-28 11:34 PM
At first, I noticed that when a PC failed to recognize the USB CDC device, the LED on the USB hub did not light up, indicating that the hub was not supplying power at all.
To find the root cause, I tested all the public PCs in our office, trying to find one that could not recognize USB CDC, so I could use it as a clean sample to install all the applications currently on my PC.
However, all of them were able to recognize USB CDC when using my externally powered USB hub.
So I started testing my coworkers' PCs and found one that couldn't recognize USB CDC. Interestingly, it was able to recognize USB CDC when using an externally powered USB hub.
After that, I tested several other coworkers' PCs, and all of them could recognize USB CDC with the externally powered USB hub.
Additionally, even on the same laptop, different USB ports can provide different power levels. For example, on one of my coworker's laptops, the left USB port could recognize USB CDC, but the right USB port could not.