2015-12-17 10:23 AM
We are planning to migrate from FTDI in our product.
The product has an STM32F205 and we want to use it's internal USB peripheral. However we have some trouble getting it working.We use STMCube CDC driver on OTG_FS mode pin PA11/PA12 and STM is self powered state so no VBUS connected since it is configured as peripheral device only.But we got trouble since we can't re enumerate it and that is a must since we want to switch from flash dfu mode to application CDC mode and vise versa.Hardware configuration:* Core system VCC 3v? (is 3v enough for USB?)* 25Mhz crystal system clock 120Mhz and USB CLK 48Mhz* DP/DM lines no external pullup or resistors in serial.* VBUS is not connected or configuredI have tried toggle (disable/enable) VBUS sensing bit. None of that did the trick.My question is how do I get the system to re enumerate?I also noticed that CDC driver also is unstable I am not sure if that is cause of some of above is wrong. But it seems CDC_Control_FS is only called when comport is open and second time I open it is not called. But sometime it is not called et all.Not sure if CDC problem is cause of the host driver(linux serial driver) or if this also related to above HW configuration or STM driver issue?2015-12-18 07:43 AM
> My question is how do I get the system to re enumerate?
To start re-enumeration, the device should disconnect first, and re-connect after enough pause in which host OS fully disposes the device instance / process. On the STM32Cube stack, USB_DevDisconnect() / USB_DevConnect() does the job. 200 - 300 ms pause should work for Linux.> But it seems CDC_Control_FS is only called when comport is open and second time I open it is not called. What is CDC_Control_FS ? I can't find such function in the stack.> STM is self powered state so no VBUS connected since it is configured as peripheral device only. VBUS pin should be connected for self-powered device. - detection of plug-off - suppress spurious USB interrupt caused by noise on the line during disconnection. Tsuneo