cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407VG Discovery Board as USB HOST and connect with Mouse.

Vivek yadav1
Associate III

Hi,

I want to connect USB Mouse with my Discovery Board and want to communicate with USB protocol. Where

USB device --->> USB mouse

USB HOST --->> STM32F407VGT6 Discovery Board.

IDE --->> STMCube IDE and STMCubeMX for HAL Library for easy understanding.

Questions :

Q.1: I am not getting any example so i can test. I am sure Mouse and Keyboard examples are very common but I am not getting easily.

Q.2: I tried by myself using HAL library but When I am connecting my mouse with "Board". My mouse is not getting any power because Red Led which mouse has, is not glowing. Which directly means emuration process fails. Although I check my hardware which seems perfectly fine. except I am not getting 5V to operate a wired mouse.

I am attaching schematic for your reference where you can search CN5.

Can anyone face similar issue with this Board ?

Q.3: I used you Function which i add by myself into main file.

-->> USBH_StatusTypeDef USBH_HID_MouseInit(USBH_HandleTypeDef *phost);

-->> HID_MOUSE_Info_TypeDef *USBH_HID_GetMouseInfo(USBH_HandleTypeDef *phost);

Thanks & Regards

Vivek Yadav

1 REPLY 1
Vivek yadav1
Associate III

Hi,

Let me update about my problems.

1: I found example code within HAL library by seeing STMicroelectronics youtube channel.

2: while searching I lost connection with on board debugger. Now it is not working. and I am using external debugger for programming my board.

But some how I am able to connect my wireless mouse with my Discovery board.

HOW I did this.

I make my VBUS pin which is PA9 in my case. I config this pin in output mode and make high so I get power supply of 3V and wireless mouse able to send its report. Where as wired mouse is still not working as expected because it requires 5V.

Now I am on my next task.