cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable USB port through software

soobia
Associate II
Posted on June 25, 2014 at 12:46

Sir,

I have successfully initialized USB port on Hi mini STM32F1V board now I would like to design a software routine to disable the initialized USB port plz help me out how to implement this.

Regards 

#stm32f1-usb-port-programming
1 REPLY 1
joe
Associate II
Posted on June 26, 2014 at 11:00 I haven't done this but this is how I would approach it. The initialization is done by calling the function,MX_USB_HOST_Init(). This function calls

USBH_Init(&hUsbHostFS, USBH_UserProcess, HOST_FS);

The is a matching USB_DeInit function:

USBH_DeInit(USBH_HandleTypeDef *phost)

to which you would passhUsbHostFS. Then you can re-assign your USB GPIO's as required. Worth a try.