cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F205 and OSB_OTG_FS problem with enumerate and CDC driver

mikael2
Associate II
Posted on December 17, 2015 at 19:23

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 configured

I 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?

1 REPLY 1
tsuneo
Senior
Posted on December 18, 2015 at 16:43

> 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