Skip to main content
srdjan
Associate III
June 10, 2016
Question

STM32L0 USB slow after second cable replug

  • June 10, 2016
  • 2 replies
  • 686 views
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?

    This topic has been closed for replies.

    2 replies

    tsuneo
    Associate II
    June 12, 2016
    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
    srdjanAuthor
    Associate III
    June 14, 2016
    Posted on June 14, 2016 at 14:43

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