"STM32F429 USB HID configuration issue - code gets stuck in dev_state check"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-20 9:19 PM
"I configured my STM32F429 with USB HID class communication in CubeMX. After generating the code, I'm having trouble detecting the USB connection on my PC. I've tried debugging and the MX_USB_Device_Init function works correctly, but in the condition that checks if the dev_state has reached 3 for proper configuration, the code gets stuck. How could i solve it?"
- Labels:
-
Gerber
-
ST-Link
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-23 12:27 AM - edited ‎2025-03-23 12:27 AM
The enumeration needs to have completed for USBD_STATE_CONFIGURED. Do you have a usb protocol analyzer? If not you could at least use wireshark to see a bit of what is going on. Maybe not much is going on if your clocks aren't configured or something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-23 4:18 AM
I used USBDeview and didn't detect anything except the debug USB. I'll still try with Wireshark to check.
For the clock, it's properly configured and set to 48 MHz.
 
 
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-23 4:19 AM
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-24 5:15 AM - edited ‎2025-03-24 5:20 AM
Is it a custom board or a discovery STM32F429? Which PHY does it have onboard? OTG_FS or OTG_HS?
USDBeview won't show anything but Wireshark might. If it's not doing any USB data at all and not just failing enumeration then you might not see anything. Maybe you are connected to the wrong thing? The OTG_FS controller is probably not the one hooked up if it has a OTG_HS controller.
Edit: Looks like the usb connector is hooked up to the OTG_FS controller on the discovery board. If that's what you are using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-24 5:35 AM
My board is a discovery one and it have OTG-HS controler tkx
 
 
