shangdawei / arm-utilities

Automatically exported from code.google.com/p/arm-utilities
0 stars 0 forks source link

Incomplete work-around for STLink USB bugs #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Plug in a STLink
2. Attempt to use it immediately
3. Hilarity ensues

What is the expected output? What do you see instead?

You expect to be able to use the device immediately.

The device pretends to be a USB mass storage device ("flash key").  But it
only implements the bare minimum needed to fool Windows.  When Linux tries
to read the partition table, the device responds incorrectly, triggering
many retries before the Linux kernel gives up trying to recover from the error.

One part of the solution may be to write a udev rule that treats the STLink 
device specially, turning off automount attempts.

I have been able to write udev rules to create /dev/stlink with appropriate 
ownership and permissions, but have not yet figured out where to block the 
automount.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by donald.b...@gmail.com on 6 Mar 2011 at 10:42

GoogleCodeExporter commented 9 years ago
The June 22 version now does a more complete job of waiting and re-opening the 
device file.

This should fix most of the issues.

A remaining issue is that it only waits and re-opens only if it recognizes the 
proper USB vendor/device ID.  Since the USB ID takes 5-10 seconds to be valid, 
you can't plug it in and immediately run a command.

Original comment by donald.b...@gmail.com on 22 Jun 2011 at 2:56

GoogleCodeExporter commented 9 years ago

Original comment by donald.b...@gmail.com on 25 Jun 2011 at 4:45