2013-04-18 05:13 AM
Hello everybody,
I have a board with stm32f207 and I use GPIO_AF_OTG2_FS as USB device connection, and I have sometime a strange problem when I plug the USB cable. When I plug the cable, all is working correctly and I go into all steps of USB detection (reset, enumeration, addressing, ...). After that, if I unplug and re-plug the cable, the connection is sometime not recognize by the PC. I made some diagnostic and in this case some interrupts occur (sessreqintr, usbreset, enumdone), but the process stop here and I never go into addressed state. If fact, the configuration of the USB stack from ST is not really clear about the defines. So my configuration is : - GPIO (portB : 12, 13, 14, 15) as alternate function GPIO_AF_OTG2_FS (excepted VBUS which is on input mode) - interrupt : BSP_PERIPH_ID_OTG_HS and BSP_INT_ID_OTG_HS - usb_conf.h : USE_USB_OTG_FS + USB_OTG_FS_CORE + VBUS_SENSING_ENABLED - core : USB_OTG_HS_CORE_ID Is there anybody with a good idea to help me? Thanks. Thomas2013-04-18 11:53 PM
Nobody have an idea about this problem ?
I don't know if this problem comes from my board or from my computer. Maybe the computer does not send the addressing command ? Is that possible ? I have added a callback when the ''disconnect'' interrupt occurs (througth the VBus pin) to reset completely the USB pins (DP, DM, ID switched to inputs). The behavior is quite better but it remains sometimes the addressing command is not received (no ''endpoint out'' interrupt occurs after the ''enumaration done'' interrupt).2014-09-30 12:36 AM
This is long,
long
after the question, but I think PB13 should also be set to alternate function for the USB. I can't say whether that would affect the symptom as I'm not using VBUS sensing. There is something odd about PB13, because even when set as a GPIO, the VBUS_SENSING affects the pin, holding it low.