0
\$\begingroup\$

My STM32 project has an issue about VCP on a CubeMX generated project.

When the USB cable is plugged in, the windows10 can't recognise it and in the device manager panel, it says "Unknown USB Device(Descriptor Request Failed), error code 43". The funny thing is after the USB cable been plugged in and out several times (usually more than 10 times), windows suddenly can recognize it. After that, if I power off the board for a short time(several seconds), the USB can always be recognized successfully by windows even if it is plugged out and in repeatedly; but if I shut down the board for a long time, then the issue will arise again.

I've taken the following steps to debug it but no effect:

  • I build a simple project on CubeMX with just OTG_FS, this issue is still existing.
  • I've also tried to enable/disable VBUS sensing function but it's the same.
  • I've measured the voltage on DP and VBUS which are 2.8v/4.4v when this issue exists.

I can't think of another method to debug this issue. Any ideas or suggestions about solving this issue is welcome. Thank you!

These are information related to the USB in my project:

The chip is STM32F205VGT, cubeMX version is 5.0.1.

Keil version:

enter image description here

USB configration:

enter image description here

enter image description here

Clock:

enter image description here

Schematic and PCB, the board is powered from wall supply rather than VBUS:

enter image description here

enter image description here

Updated:

Finally, the issue is fixed by resoldering the 16MHz crystal which may not contact well enough in the first version.

\$\endgroup\$
  • \$\begingroup\$ Screenshots don't constitute code, nor have you provided the circuitry around the MCU itself. Might be worth temporarily adapting it to bus power to reduce variables. \$\endgroup\$ – Chris Stratton Mar 6 '19 at 4:52
  • \$\begingroup\$ @ChrisStratton To avoid code error, the simple project is all generated with CubeMX, I don't write a single line code. \$\endgroup\$ – Ross Mar 6 '19 at 4:58
  • \$\begingroup\$ If you're going to develop by point and click, post only screenshots, and omit schematics you don't have an answerable question on an SE site. Perhaps ST support will help you. \$\endgroup\$ – Chris Stratton Mar 6 '19 at 5:02
  • 1
    \$\begingroup\$ @Ross: Since you found it, would you please post an answer and explain how you figured it out? You can then accept the answer, and leave things nice and tidy. \$\endgroup\$ – JRE Aug 13 '19 at 20:00
  • 1
    \$\begingroup\$ As JRE says, Ross please post resoldering the 16MHz crystal as an answer. \$\endgroup\$ – StainlessSteelRat Aug 13 '19 at 21:30
1
\$\begingroup\$

When I switch the clock source to HSI, the USB connection build successfully, so the reason may be the poor quality of crystal oscillator or bad soldering. I resolder the crystal oscillator and this time the USB can get connected with no issue.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

I had the same problem and after some headaches, I realized that the nucleo board I was using has the clock coming from the st-link locked in at 8MHz. CubeMX default settings had it set to 25MHz for me. Switching HSE to 8MHz (bypass mode) did the trick!

enter image description here

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

In my case I changed input frequency of HSE from 16 Mhz to 8 Mhz and it helped.

Screenshot:

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.