Skip to main content
Explorer
August 2, 2025
Question

USB Communication Disconnect

  • August 2, 2025
  • 2 replies
  • 389 views

Hello team,

Good day,

I am having USB Disconnect Issue with my custom board based on STM32F303 Device, configured as USB HID in Firmware with Full speed. Schematics attached here with.

It is Self-Powered board and no VBUS Detection implemented, Currently.

USB Cable from HOST PC will always plugged into our Board and upon power on it detects the Board as HID device successfully. and communication works fine as well.  

Issue is : During real-time communication windows HID Function finds device disconnected. PC application is based on MFC VC++.

We are not sure if it is beacuse of Noise or Immidiate VBUS Detection ?

 

Regards,

Bsuthar

    This topic has been closed for replies.

    2 replies

    Super User
    August 2, 2025

    Schematic is fine.

    Could be a software issue, or cable issue, or PC software issue.

    bsutharAuthor
    Explorer
    August 6, 2025

    Hi TDK,

    We use Shielded High Quality cable from Samsung , 1.8 Meter Length.

    PC Software Uses standard HID Write / read Function from Windows It self. OS is Win10.

    Firmware is based on ST`s HAL USB HID Library.

    1. Would it be good to add Common mode Filter between USB connector & STM32 (i.e  260Ω@100MHz 310mA 500mΩ 50V ) ?

    2. Any distance Trace length limitation on Layout side , Currently it is 45 mm between MCU & Connector...

    3. For Schematic, ST USB training says to connect VBUS to I/O line of USLC6-4S ESD Chip , Instead connecting it to its VBUS pin.

     

    bsuthar_0-1754468604922.png

     

     

    Technical Moderator
    August 4, 2025

    Hi @bsuthar 

    If the USB device is self-poweredVBUS sensing is mandatory. It is recommended to add a simple VBUS detection circuit (e.g., voltage divider or comparator) to sense 5 V from USB host. Detect VBUS presence in your firmware before enabling USB peripheral and Handle USB detach/attach events properly.

    bsutharAuthor
    Explorer
    August 6, 2025

    Thank you , FBL 

    OK.  We will Try to implement. I believe STM32F3 device is not PA9 enable for VBUS Detection, We may have to use EXT on GPIO.

    1. Do you Recommend such application where EXT GPIO used as VBUS detection @ HAL code  Level ?

    2. Just to confirm , Do you believe absence of VBUS Detection will also create issue after Enumeration , I mean after power tup and during the Run-time ?

     

    Regards,