2016-02-16 02:03 AM
Hello Everybody,
Hello ST,We've implemented some USB class for communicating with an Android device. The application is working fine when plugging it in for the first time. But when disconnecting the USB cable and reconnecting it once again, it seems to be messing up an internal state of the USB Host Driver ending up in a deadlock.Mikrocontroller: STM32F401xB/CUSB Host Driver: V3.2.2HAL Driver: V1.3.2Compiler: gcc version 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848]We are following the init procedures as descriped in the examples. Mikrocontroller: STM32F401xB/CUSB Host Driver: V3.2.2HAL Driver: V1.3.2Compiler: gcc version 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848]We are following the init procedures as descriped in the examples. 1. We init the pipes in the ''init'' class functiona. USBH_FindInterface(...)b. USBH_SelectInterface(...)c. AllocPipe(...)d. OpenPipe(...)e. USBH_LL_SetToggle(...)2. Application statemachine magic following.. and working3. After disconnecting the usb device its calling the ''deinit'' class functionsa. Check if Pipe exists (!=0)b. USBH_ClosePipe(...)c. USBH_FreePiped. Cleaning up pdataAfter re-attaching the device once again the complete implementation seems to choke. I still see some (hand written) debug output pulling following functions in an endless loop (even after detaching it once again after hanging).DBG USBH_Get_DevDesc(114): DBG USBH_GetDescriptor(216): DBG USBH_CtlReq(560): DBG USBH_HandleControl(610): Is there some known problem and/or a workaround?Best Regards,HolgerConfiguration of the basic USB functionality:hhcd.Instance = USB_OTG_FS;hhcd.Init.Host_channels = 8;hhcd.Init.dma_enable = 0;hhcd.Init.low_power_enable = 0;hhcd.Init.phy_itface = HCD_PHY_EMBEDDED;hhcd.Init.Sof_enable = 0;hhcd.Init.speed = HCD_SPEED_FULL; #bug #usb #adams.holger #stm32cube2016-11-24 01:40 AM
Hello Adams,
I'm also trying to connect stm32f4 as host to android through USB,my Microcontroller is stm32f407vgt6. I can't find available driver for stm32 USB on android, could you share how you you implemented the driver on android to exchange data with the stm32 microcontroller?