2017-11-23 04:09 AM
Hi everyone,
I'm developing an HID Host application to comunicate with a own device and I'm using the NUCLEO-F446ZE board.
At the start I tried to use the HID_Standalone application in the STM32CubeF4 firmware package and then, I tried to develop a new application with STMCube configurator.In both case I tried to connect (with OTG connector) 3 different type of mouse and 1 keyboard and no all device are able to comunicate with microcontroller:
All the previous devices are tested with PC and work fine and the board are powerd with external source.
What can be the problem and how can I fix it?
Thanks in advance
#usb-hid #usb-host #stmcube-f4-usb #middlewareSolved! Go to Solution.
2021-04-29 11:18 AM
I'm hopeful that my answer is useful after about 3 years!
This is because of your PCB design, not the code. Most of the microcontrollers, same as STM32F407, only have one USB port that can be configured as the Host or Device. But in the evaluation boards, the Discovery board for example, there are both the Host and Device physical ports. These ports share the D+ and the D- pins of the microcontroller. Based on USB standard, in the full-speed device mode, there is a 1.5k pull-up resistor connected to the D+ pin. If you need to use the system in the Host mode, you will be sure that this pull-up resistor is disabled based on PCB schematic details. Each USB device (keyboard, mouse, etc) internally includes this resistor. Using this resistor the Host can detect the type of the connected USB device and the exact plug-in time. After plug-in detection, the host will start the enumeration procedure. Otherwise, the host can not detect the correct moment of device insertion and will run enumeration miss alined. In this situation, the enumeration procedure always reports some sort of errors same as USBH_busy.
You can find more details about USB wiring at the following link:
https://www.beyondlogic.org/usbnutshell/usb2.shtml
Regards