Skip to main content
JBond.1
Senior
January 23, 2024
Solved

USB HID mouse does not work on STM32F411

  • January 23, 2024
  • 2 replies
  • 2098 views

Hi, I have STM32F103 and STM32F411. I have successfully made HID mouse on STM32F103, but when I try to make the same on STM32F411, the mouse does not work: "(Code 43) A request for the USB device descriptor failed".

What could be the problem?

The code/configuration is simple I just enable:
Connectivity -> USB_OTG_FS -> Mode: Device_Only
Middleware -> USB_DEVICE ->  Class for FS IP: Human Interface Device class (HID)
Everything else is kept default.

Is this because STM32F103 has micro USB and STM32F411 has type-c? Does type-c need additional settings which I am missing?

Best answer by JBond.1

Nevermind... It seems that I set wrong oscillator value... 16Mhz instead of 25Mhz! Now mouse example is working!

2 replies

AScha.3
Super User
January 23, 2024

Hi,

Is this because STM32F103 has micro USB and STM32F411 has type-c?

No, the message tells you: "..USB device descriptor failed".

So look in your F103 project, what is missing in F411 project (-- device descriptor ) .

"If you feel a post has answered your question, please click ""Accept as Solution""."
JBond.1
JBond.1Author
Senior
January 23, 2024

I don't think I have changed anything manually. Everything should be kept as default after generating the project with CubeMX.

Andrew Neil
Super User
January 23, 2024

@JBond.1 wrote:

I don't think I have changed anything manually. Everything should be kept as default 


But defaults could be different between F103 and F411 ... ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
JBond.1
JBond.1AuthorBest answer
Senior
January 23, 2024

Nevermind... It seems that I set wrong oscillator value... 16Mhz instead of 25Mhz! Now mouse example is working!