cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with USB device stack (VCP)

root
Associate II
Posted on October 25, 2011 at 22:23

Hello,

First I4m working on my own board, a product almost final on which I added USB. MCU is STM32F205RE and ''of course'' I used the HS USB port (using embedded PHY).

Now I'm trying to get it working and it is VERY twitchy ... first if I plug or unplug the USB cable while powered up => hard fault (did not check yet exactly why).

Then even if I start with USB cable, 90% of the time windows says the USB peripheral is unknown/did not work, and 10% of the time the driver installation starts with the right descriptor strings, fails and the device appear in the device manager with a yellow icon and error code 10 (device can't start).

My MicroB USB connector is directly connected to PB13 (VBUS), PB14 (DM) and PB15 (DP). VBUS is only for sensing and never for powering the board.

Any idea ?

Thomas.
14 REPLIES 14
root
Associate II
Posted on October 26, 2011 at 11:10

According to this document : 

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00237391.pdf

Page 150/163, my physical implementation seems ok (direct connection to DM, DP and VBUS, but I don't use an LDO because the board is powered by it's own supply).

Then it seems it is software related :(

Thomas.
root
Associate II
Posted on October 26, 2011 at 12:45

Back again,

Seems I found an issue ... I'm using a ceramic resonator from MuRata to provide clock.

But I was using ''standard'' resonator, and from what I read, only their ''tight tolerance'' version is compatible with USB2.0 FS.

I'm trying to get samples asap ...

Regards,

Thomas.
root
Associate II
Posted on October 26, 2011 at 13:38

Me again (not just for flood, but it may help someone in the same situation).

About ceramic resonators and USB :

- USB2.0 FS requires a +-2500ppm (+-0.25%)clock accuracy.

- Standard accuracy (when adding initial calibration, temp deviation and aging drift) for MuRata CSTCE (called G55) is +-0.8%, which is not compliant

- The tight tolerance version (G15) is exactly within the +-0.25% required by USB2.0

- As they sell the same package and same marking with different tolerances, I assume all units come from the same factory line, and after production they test it and classify its tolerance depending on the test result. This mean even with chance, the G55 will probably never be in the 0.25% range ... because then it would have been sold as a G15.

I found the G15 version at mouser : http://lu.mouser.com/ProductDetail/Murata/CSTCE8M00G15C99-R0/?qs=sGAEpiMZZMsBj6bBr9Q9aSrrnQdmJfHxte3VrRPRha4%3d

The G15 version costs about twice as much as the G55 version (not that bad).

I ordered a few units at mouser to confirm and will tell the result here.

Thomas.
root
Associate II
Posted on October 26, 2011 at 16:07

Final word ...

Got MuRata on phone ... that will probably work most of the time with the G15, but for production it is not the recommended reference.

For USB2.0 FS they recommand the ref CSTCW24M0X11047 which is a 24MHz resonator (no problem on the STM32).

They can even take a board and craft a customer specific reference that is paired with the MCU to get the exact specifications you want free of charge.

Thomas.
root
Associate II
Posted on October 29, 2011 at 13:49

Ok I received the new resonators from Mouser ....

First one, very weird, run firmware, plugged USB, recognized as ST stuff, driver install failed, cannot start.

Reboot board, plug again, nothing ... did multiple times, still nothing. Flashed my application firmware .... WTD the led blick a at least half slower than it should be !!!!!

Mounted a new resonator ... exact same behavior than with the old one (with standard tolerancies). 95% of the time it doesn't show up or shows as unknown device (that failed, code 43), 5% of the time, recognizes as ST VCP, starts driver installation and fail, then says device cannot start (code 10).

I'm really FED UP with ST stuff ... they document a non existing USB port (FS is not there on the F205), the MicroXplorer tool offers ''analog'' on each pin of the device (even where there is no ADC, yes ... ho and you can of course configure your USB FS port in Xplorer too), the USB stack is not working, etc.

On TASKING, try to import the HID demo project, it compiles, switch to EMBEDDED_PHY and it doesn't even compile !!!!! Do you guys test your software before releasing it ?????

I lost so much time because of ST and their tech support ... they have great microcontrolers, but support is almost non existing.

Documentation on the USB stack IS totally non existant, you just have to read the code and guess ...

[EDIT] Ho and I forgot .... the forums that are down approx half of the time, buggy everywhere, slow, etc ... I2C (even master !) is just a joke, etc
root
Associate II
Posted on October 29, 2011 at 14:45

Downloaded Atollic Lite to test ....

Can't even compile the VCP demo using the provided instructions.

Can someone compile the VCP demo using HS EMBEDDED PHY on STM32F205 and send me the HEX file ?

Don't know what is THE supported tool by ST, but it seems I don't have it ...
root
Associate II
Posted on October 29, 2011 at 15:11

Back to TASKING ....

I tried the different device proejcts provided and ..... surprise, MSC (Mass Storage) is enumerating correctly, and install drivers as expected.

Of course I didn't test more than that because my board has no SD card connected ... but that proves that the hardware is ok, and the software is crap ...
root
Associate II
Posted on October 29, 2011 at 16:36

I stated debugging the stack (hell yes, always wanted to know the very inner workings of the USB stack ...).

It seems the configuration phase goes ok, but then the board keeps triggering DCD_HandleSof_ISR. I mean if I put a breakpoint at the very beginning of this interrupt (called by OTF_HS_IRQHandler), then another interrupt is already pending.

I have no trigger on the EP1 dedicated IRQ handlers (I had some in the MSC firmware).

Could somebody (ST Tech support, by chance ...) look at it please, it really is annying.

 

Thomas.

 

</b>

root
Associate II
Posted on November 02, 2011 at 16:24

*bump*

Reviewing all documentation I can find, I often see 22 ohm resistors between DP/DM on the MCU and DP/DM on the USB connector. Are they mandatory?

I added them on my design for next revision. I also added the 1.5kohm pull up resistor on DP, but it seems STM32F2 OTG HS doesn't need it because it has them internally and switch them on/off depending on the current configuration (host, device, etc).

Nothing on software side ?

Did someone got the VCP demo to work on something with OTG HS embedded PHY ?

I asked HCC to provide me a demo firmware to see if it can work, but I'd like to make the ST stack working (I don't have an RTOS and don't want to use one ...).

Why is the SD Card demo working (at least enumerates well and install drivers), and VCP cannot start (code 10) ?

Thomas.