cancel
Showing results for 
Search instead for 
Did you mean: 

USB_OTG_FS Device Recognition Error

HMsDobby2
Associate III

Hello,
I'm using the nucleo-h743zi2 board.

I am trying to use the USB OTG FS function.

The .IOC file settings are as follows:

  • USB_OTG_FS enabled
  • MODE: DEVICE_ONLY
  • VBUS: disable
  • uncheck SOF

I provided power through an external source and also swapped the D+ and D- lines of the USB.

The USB connection LED on the board turns on, but a USB device recognition error occurs in the Device Manager of my computer.

Is there a way to resolve this situation?



1 ACCEPTED SOLUTION

Accepted Solutions

If USB device is not recognized properly, but computer (e.g. Windows) sees "something" (in Device Manager), but does not realize properly what the USB device is...:

The Enumeration went wrong: the USB descriptors sent by the MCU (as device) are not correct or not properly received by the host (computer):

  • USB D+ and D- are sensitive signals! (and do not swap!)
    - keep them short as possible
    - make sure they are really "differential signals" on PCB
    - make sure, the impedance for these signals is correct
    - these signals are not "simple digital signals"
    If a wrong PCB design - you can have bit errors.
  • check your USB peripheral clock in MCU:
    - is the clock source for USB a good one (precision of OSC/XTAL good enough)?
      (running USB from an internal RC-OSC, like HSI, might never work)
    - is the clock source and PLL config correct? (e.g. using HSE and PLL with correct divider settings for
       USB core clock)?
    If the clock is a bit off or the clock source is not accurate enough - you will get bit errors.
  • Check the enumeration:
    - are all the USB descriptors correct?
    - are they all really sent (based on a request to do so sent by the host)?
  • Use an USB analyzer on the host computer, e.g. WireShark can debug USB:
    - is the Enumeration received and seen by the host computer "reasonable" (and error free)?

The good news is: your MCU USB seems to send something, but the host PC will not get it error free. Therefore an "unknown device": bit errors or wrong USB descriptors (for Enumeration).

View solution in original post

4 REPLIES 4
FBL
ST Employee

Hi @HMsDobby2 

Could you explain why do you swap D+ and D- lines? This is not a common practice and can mess up communication. These lines are differential pairs used for data transmission, and they must be connected correctly for proper operation.

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.

If USB device is not recognized properly, but computer (e.g. Windows) sees "something" (in Device Manager), but does not realize properly what the USB device is...:

The Enumeration went wrong: the USB descriptors sent by the MCU (as device) are not correct or not properly received by the host (computer):

  • USB D+ and D- are sensitive signals! (and do not swap!)
    - keep them short as possible
    - make sure they are really "differential signals" on PCB
    - make sure, the impedance for these signals is correct
    - these signals are not "simple digital signals"
    If a wrong PCB design - you can have bit errors.
  • check your USB peripheral clock in MCU:
    - is the clock source for USB a good one (precision of OSC/XTAL good enough)?
      (running USB from an internal RC-OSC, like HSI, might never work)
    - is the clock source and PLL config correct? (e.g. using HSE and PLL with correct divider settings for
       USB core clock)?
    If the clock is a bit off or the clock source is not accurate enough - you will get bit errors.
  • Check the enumeration:
    - are all the USB descriptors correct?
    - are they all really sent (based on a request to do so sent by the host)?
  • Use an USB analyzer on the host computer, e.g. WireShark can debug USB:
    - is the Enumeration received and seen by the host computer "reasonable" (and error free)?

The good news is: your MCU USB seems to send something, but the host PC will not get it error free. Therefore an "unknown device": bit errors or wrong USB descriptors (for Enumeration).

BTW:
Even the USB cable length can matter, esp. if the USB traces on your PCB are not really correct (e.g. different length of traces for D+ and D-, not an impedance match).

Check your PCB, use a shorter USB cable, use an USB analyzer...

I checked and found that the clock configuration settings were incorrect, but now everything is working fine.

Thank you.