On 2007-09-24, Grant Edwards <[email protected]> wrote:

> I know how to set up udev rules.  I assumed that when people
> said to use a hotplug script that they were right.  

It turns out, I should have followed this web page:

http://people.ee.ethz.ch/~npreyss/msp430/

The udev approach is a lot easier than using hotplug
(especially if hotplug doesn't work on your machine).

Here are two udev rules.  The first (copied from the above web
page) checks the confguration value, and if it's 1 it changes
it to 2.

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'"

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:


  $ ls -l /dev/ez430
  lrwxrwxrwx 1 root root 7 2007-09-24 19:07 /dev/ez430 -> ttyUSB1

  $ msp430-gdbproxy msp430 --spy-bi-wire /dev/ttyUSB1
  
  Remote proxy for GDB, v0.7.1, Copyright (C) 1999 Quality Quorum Inc.
  MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood
  
  GDBproxy comes with ABSOLUTELY NO WARRANTY; for details
  use `--warranty' option. This is Open Source software. You are
  welcome to redistribute it under certain conditions. Use the
  '--copying' option for details.
  
  debug: MSP430_Initialize()
  debug: MSP430_Configure()
  debug: MSP430_VCC(3000)
  debug: MSP430_Identify()
  info:      msp430: Target device is a 'MSP430F20x3' (type 52)
  debug: MSP430_Configure()
  notice:    msp430-gdbproxy: waiting on TCP port 2000

  
  $ msp430-gdbproxy msp430 --spy-bi-wire /dev/ez430
  
  Remote proxy for GDB, v0.7.1, Copyright (C) 1999 Quality Quorum Inc.
  MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood
  
  GDBproxy comes with ABSOLUTELY NO WARRANTY; for details
  use `--warranty' option. This is Open Source software. You are
  welcome to redistribute it under certain conditions. Use the
  '--copying' option for details.
  
  debug: MSP430_Initialize()
  ioctl: Invalid argument
  error:     msp430: Could not initialize device interface (1)
  

The problem is that msp430-gdbproxy is doing a PPCLAIM ioctl()
call on a serial port.  Apparently msp430-gdbproxy requires
that serial ports have names that match some sort of pattern.

I'll have to see if I can find a work-around for that...

-- 
Grant Edwards                   grante             Yow! ... this must be what
                                  at               it's like to be a COLLEGE
                               visi.com            GRADUATE!!


Reply via email to