bugAVR Downloader/UploaDEr - Bugs: bug #31779, Add support for addressing...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31779: Add support for addressing usbtinyisp with -P option

Submitter:  None
Submitted:  Sat 04 Dec 2010 11:25:53 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  joerg_wunsch Originator Name:  Grygoriy Fuchedzhy
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  None Programmer hardware: 
Device type: 

Jump to the original submission

Wed 17 Aug 2011 08:59:47 PM UTC, comment #7: 

I have one minor correction to documentation you wrote, windows example in the example section is not correct:
-P usb:bus-0/\\.\libusb0-0001--0x1781-0x0c9f
there should be one more ":" in that string, I think something like:
-P usb:bus-0:\\.\libusb0-0001--0x1781-0x0c9f

However I don't know how exactly it will look like on windows.

Grygoriy Fuchedzhy <gry>
Wed 17 Aug 2011 03:27:34 PM UTC, comment #6: 

Thanks for the quick followup!

Documentation changes were still lacking, but I did that myself
by now.

Added in r974.

Joerg Wunsch <joerg_wunsch>
Group administrator
Wed 17 Aug 2011 02:13:45 PM UTC, comment #5: 

 . Please don't mess with the code in main.c, at

> least not within a patch that is supposed to only
> affect the usbtiny.


done

> . For consistency, please follow the -P usb
> convention as used by other USB-based
> programmers. I.e., plain -P usb (which should be
> the default fot the usbtiny) means "use the first
> matching device found on the USB", and -P
> usb:<something else> means "use a specific
> device". For other USB-based programmers
> <something else> is the (trailing part of the)
> serial number, for the usbtiny, the idea to use
> the (OS-specific) bus/device pair has some merit.


done. Just like it was in previous patch bus is
struct usb_bus::dirname.  device is struct usb_device::filename.
User always can look how they look like using -v option.

> . When (at least) one -v option has been
> specified, make the code print out all candidate
> devices (i.e. everything where the VID/PID
> matches). That way, the user can get a list of all
> candidate devices by specifying a guaranteed to be
> invalid string for <something else>; the
> documentation mentions "-v -P usb:xxx" as an
> example. The list of candidate devices that is
> printed then should be given in a way so the
> output can be copy&pasted into the
> commandline. Examples could look like:


done.

Please review and test as I can test using linux only.
New patch is against avrdude-5.10
Thanks!


(file #23824)

Grygoriy Fuchedzhy <gry>
Tue 16 Aug 2011 10:35:09 AM UTC, comment #4: 

Oops, the web interface eats up some backslashes.  For
reference, the Windows device names look like:

bus-0/\\\\.\\libusb0-0001--0x03eb-0x2103

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 16 Aug 2011 10:30:42 AM UTC, comment #3: 


> I'd like to see that patch tuned in a way so the bus/device numbers
> can be given as just "-P usb:0.4"


Well, Windows appears to use bus:device names like

bus-0/\\.\libusb0-0001--0x03eb-0x2103

Looks too complicated to derive some kind of generic name
from that.

My suggestions:

. Please don't mess with the code in main.c, at least not within a
  patch that is supposed to only affect the usbtiny.  (A more generic
  per-programmer default device scheme would be welcome, but then, as
  a separate patch, please.)

. For consistency, please follow the -P usb convention as used by
  other USB-based programmers.  I.e., plain -P usb (which should be
  the default fot the usbtiny) means "use the first matching device
  found on the USB", and -P usb:<something else> means "use a specific
  device".  For other USB-based programmers <something else> is the
  (trailing part of the) serial number, for the usbtiny, the idea to
  use the (OS-specific) bus/device pair has some merit.

. When (at least) one -v option has been specified, make the code
  print out all candidate devices (i.e. everything where the VID/PID
  matches).  That way, the user can get a list of all candidate
  devices by specifying a guaranteed to be invalid string for
  <something else>; the documentation mentions "-v -P usb:xxx" as an
  example.  The list of candidate devices that is printed then should
  be given in a way so the output can be copy&pasted into the
  commandline.  Examples could look like:

  Linux:

  avrdude: usbdev_open(): Found USBtinyISP, bus:device: 003:001

  FreeBSD (recent USB subsystem):

  avrdude: usbdev_open(): Found USBtinyISP, bus:device: /dev/usb:/dev/ugen1.2

  FreeBSD (old USB subsystem):

  avrdude: usbdev_open(): Found USBtinyISP, bus:device: /dev/usb0:/dev/ugen0

  Windows:

  avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0/\\.\libusb0-0001--0x03eb-0x2103

  Other systems (like Solaris) would then self-adapt to this as well
  (since the printed strings are exactly those as reported by libusb).

I'm setting the status to "Postponed", because I don't have
the resources to adapt the patch to this right now.
Volunteers welcome!

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 16 Aug 2011 06:15:57 AM UTC, comment #2: 

Just for the record: this is FreeBSD prior 8.x:

bus_name:dev_name: /dev/usb0:/dev/ugen0

(Only those devices on the bus which don't have a non-generic
driver are displayed there, rather than the entire hierarchy.)

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 15 Aug 2011 05:53:47 PM UTC, comment #1: 

Unfortunately, the enumeration using bus_number:device_number is
very Linux-specific.  For example, under FreeBSD 8 (and above), the
equivalent names for all devices on one machine would look like:

bus_name:dev_name: /dev/usb:/dev/ugen1.2
bus_name:dev_name: /dev/usb:/dev/ugen0.4
bus_name:dev_name: /dev/usb:/dev/ugen0.3
bus_name:dev_name: /dev/usb:/dev/ugen0.2
bus_name:dev_name: /dev/usb:/dev/ugen1.1
bus_name:dev_name: /dev/usb:/dev/ugen0.1

No idea how it would look like under Windows.

I'd like to see that patch tuned in a way so the bus/device numbers
can be given as just "-P usb:0.4", which would then translate into
/proc/bus/000/004 under Linux, /dev/ugen0.4 under FreeBSD, and
whatever is needed for it under Windows.

Too bad Lady Ada didn't implement serial numbers.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sat 04 Dec 2010 11:25:53 AM UTC, original submission:  

I'm using usbtiny programmers.

Now there isn't way to specify which programmer exactly to use via avrdude if
there are several usbtinyisp programmers connected to my computer.

So I decided to use -P option to specify which one to use, preserving
behavior when no -P option given.

Patch against avrdude-5.10 attached.

Example of usage:

callisto ~ $ lsusb  | grep '1781:0c9f'
Bus 005 Device 123: ID 1781:0c9f Multiple Vendors
Bus 005 Device 122: ID 1781:0c9f Multiple Vendors
callisto ~ $ avrdude -c usbtiny -p m8 -P 005:123

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9307

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #22122:  usbtiny-port.patch added by None (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gry (Updated the item)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-08-17 joerg_wunsch StatusPostponed Fixed
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed
    2011-08-17 gry Attached File- Added 0001-added-addressing-of-usbtiny-with-P-option.patch, #23824
    2011-08-16 joerg_wunsch StatusNone Postponed
    2010-12-04 None Attached File- Added usbtiny-port.patch, #22122

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code