cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 USB slow after second cable replug

srdjan
Associate II
Posted on June 10, 2016 at 12:43

I have a curious problem on my STM32L151. I have the USB running in double buffering mode, and I can get a transfer rate of ~10MBit/sec. But after I unplug the USB cable, and plug it back, the transfer rate drops to ~6MBit/sec. After any subsequenct cable unplug/plug the speed remains at 6MBit. Only the first usb connection results in faster transfer rate.

This is happening 100% of the time. Does anybody has an idea what can go wrong?

2 REPLIES 2
tsuneo
Senior
Posted on June 12, 2016 at 05:26

The double-buffer endpoint should be primed twice at the start of a transfer, to make the double buffer work effectively. Does your firmware in this way?

If your firmware would prime just a single buffer at the transfer start up, the transfer speed of double buffer is slightly slower than single-buffer, because of double buffer overhead.

Tsuneo

srdjan
Associate II
Posted on June 14, 2016 at 14:43

Thank you, this was the right solution. Now I have consistent speed of USB transfers.