On 2007-09-26, David Pettit <[email protected]> wrote:
>> The second creates a symlink so that you can use /dev/ez430
>> instead of /dev/ttyUSBn. [Since n varies depending on what
>> other USB serial widgets are present, it's nice to have an
>> unchanging reference.]
>> 
>> Unfortunately, there's a bug in msp430-gdbproxy.  It chokes on
>> the symlink:
>
> You seem to have skipped a thought here.  What is the second rule???

Rats.  I forgot to include the rule in the posting (it wasn't
on the referenced web page):

KERNEL=="ttyUSB*", SYSFS{idProduct}=="f430",SYSFS{idVendor}=="0451", 
SYSFS{bConfigurationValue}=="2", SYMLINK="ttyUSBez430"

NB: I've never been able to get NAME="whatever" to work in udev
rules, despite folling examples to the letter. However,
SYMLINK="whatever" always seems to work.

> I didn't find any mention of a symlink in the webpage you
> referenced.  

My bad. Sorry about that.

> On my machine (Debian Etch), the command 
>
> prompt> echo "2" > /sys/bus/usb/devices/5-2/bConfigurationValue
>
> works, however the rule from the webpage doesn't appear to work.  I still
> get the "probe of ... failed with error -5" error message.

Here's what's in my local rules file:

KERNEL=="ttyUSB*", SYSFS{interface}=="BitScope 310", SYMLINK="ttyUSB99"
KERNEL=="ttyUSB*", SYSFS{serial}=="12345678", SYMLINK="ttyUSBhart"
KERNEL=="ttyUSB*", SYSFS{idProduct}=="2303", SYSFS{idVendor}=="067b" , 
SYMLINK="ttyUSBrs232"
SUBSYSTEM=="usb_device", ACTION=="add",SYSFS{idVendor}=="0451", 
SYSFS{idProduct}=="f430",SYSFS{bNumConfigurations}=="2",SYSFS{bConfigurationValue}=="1",
 RUN+="/bin/sh -c 'echo 2 >/sys%p/device/bConfigurationValue'"
KERNEL=="ttyUSB*", SYSFS{idProduct}=="f430",SYSFS{idVendor}=="0451", 
SYSFS{bConfigurationValue}=="2", SYMLINK="ttyUSBez430"

The last two are the rules for the ez430.

And here's what dmesg says when I plug in the ez430:

  usb 2-1: new full speed USB device using uhci_hcd and address 18
  usb 2-1: configuration #1 chosen from 1 choice
  ti_usb_3410_5052 2-1:1.0: TI USB 3410 1 port adapter converter detected
  usb 2-1: reset full speed USB device using uhci_hcd and address 18
  usb 2-1: device firmware changed
  ti_usb_3410_5052: probe of 2-1:1.0 failed with error -5
  usb 2-1: USB disconnect, address 18
  usb 2-1: new full speed USB device using uhci_hcd and address 19
  usb 2-1: configuration #1 chosen from 2 choices
  ti_usb_3410_5052 2-1:1.0: TI USB 3410 1 port adapter converter detected
  ti_usb_3410_5052: probe of 2-1:1.0 failed with error -5
  ti_usb_3410_5052 2-1:2.0: TI USB 3410 1 port adapter converter detected
  usb 2-1: TI USB 3410 1 port adapter converter now attached to ttyUSB1

Those message are all from a single "plug-in", so I still see
the -5 error twice before the adapter gets attached to
/dev/ttyUSB1.  I'm not sure what all of that means exactly, but
the last two lines didn't show up until I added the udev rule
that set the configuration value to 2 (or until I manually did
the same).

And then here's what I see if I do 

  ls -l /dev/ttyUSB*

  crw-rw---- 1 root uucp 188, 0 2007-09-24 18:44 /dev/ttyUSB0
  crw-rw---- 1 root uucp 188, 1 2007-09-26 09:30 /dev/ttyUSB1
  lrwxrwxrwx 1 root root      7 2007-09-26 09:30 /dev/ttyUSBez430 -> ttyUSB1
  lrwxrwxrwx 1 root root      7 2007-09-24 18:44 /dev/ttyUSBhart -> ttyUSB0

I finally decided to prefix the symlinks with ttyUSB in order
to keep all of the USB serial stuff adjacent in 'ls' output.
That also has the effect of making gdbproxy happy.
  
-- 
Grant Edwards                   grante             Yow! Look!  A ladder!
                                  at               Maybe it leads to heaven,
                               visi.com            or a sandwich!


Reply via email to