cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get USB Host HID on STM32F4xx to detect a USB device

THama.1
Associate

Hello,

I am trying to retrieve data from a USB mouse with a STM32F429IGT. (The reason that I typed F4xx in my question is because I tried on other F4 series MCUs)

To make sure that my wiring is correct, i connected D+ D- to PA11 and PA12 that are soldered to a microUSB. Plugging it to the computer, I detect it (on the computer), no problem. I also verified that the voltage and current are sufficient when microUSB is not plugged.

Also, the HSE is set as well, and I have a crystal oscillator that is set in RCC as Crystal/Ceramic Resonator. I can tell that it is working because I already used USB with this STM32 as a VCOM in device mode.

Disconnecting microUSB and the mouse afterwards, I activate USB_OTG_FS as host HID through CubeIDE and try the given example of mouse. However, when I plug the mouse back, nothing happens. It seems that phost->State never changes from the HOST_IDLE state. Further investigation reveals that the function USBH_LL_Connect, that, from my understanding, detects that something is on the data lines and helps in changing the state is not called when I connect my mouse.

I should point out that I am not using VBUS or activate it in anyway.

Could you help me or point out a direction of research? The tutorials on Internet make it very simple, and I don't get why I have so much trouble... Do I have to activate some kind of interrupt? Is VBUS mandatory (it seemed to me that no)?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
THama.1
Associate

I found my error. I left the functions for VCOM communication. I presume my code got stuck in the receive or send function...

I feel a bit foolish for my question :smiling_face_with_halo:

View solution in original post

1 REPLY 1
THama.1
Associate

I found my error. I left the functions for VCOM communication. I presume my code got stuck in the receive or send function...

I feel a bit foolish for my question :smiling_face_with_halo: