cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with USB lib

cemer
Associate II
Posted on July 29, 2013 at 16:07

Hi,

I am testing the usb lib 4.0.0 for the VCP functionality on STM32L15xVB targets with 1.3.1 drvier on Win7 hosts. I tried two tests with both usart bridge and loop back examples and unfortunately seeing the same issue:

Under normal conditions, both examples seem to be working fairly stable, however, with one exception: Hiberbnating or resetting the host while the usb cable is connected. After the resume of the host the mcu seems to be receiving messages but cannot send any. Cable unplug/plug sequence did not help either, although I made sure the USB peripheral is properly powered down following the cable unplug. Besides, there seems to be a buffer size limitation (truncation) on the incoming messages from the hosts as well.

Only solution seems to be hard resetting the mcu. After the reset the vcp starts to work normally.

The problem happens with both 32bit and 64bits win7 hosts.

I am looking forward to hear any experiences and any tips that might be of help.

Thanks a lot.

Cem
3 REPLIES 3
rigomate2
Associate II
Posted on July 29, 2013 at 16:53

Hi!

Try using 

http://www.usblyzer.com/

 to find the source of your problem.

It comes in ~30 day tryout period, which should cover the time to find out serious bugs.

And of course, if you like it, be sure to buy it 🙂

adrian
Associate III
Posted on July 31, 2013 at 08:46

adrian
Associate III
Posted on August 01, 2013 at 07:48

Not sure where my reply text went....but....

The problem you are experiencing is a long standing issue with the Windows CDC driver.  For whatever reason, if there is a error then windows stops polling the endpoint.

The net result of this is that while your device can quite happily receive data, you will be unable to send data to the host.

I'm afraid this is a ''game over'' situation if your device gets into this state, it's impossible to resolve without re-enumerating the device.  This is 50% of the reason that we dropped CDC support (the other 50% is the Microsoft Tax which requires that a standard USB forum class device requires a .inf file - and it's becoming increasingly more difficult to install an unsigned one in windows despite the actual driver binary being signed by Microsoft themselves).

If you do a search around the internet (CDC windows endpoint stalled) you'll find lots of discussion about this particular issue and that it's present in all versions of windows from XP to 8.

Adrian