avrrftdi driver port selection

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

avrrftdi driver port selection

Jonathan Schneider
I am trying to use avrdude 5.11.1 on i386 Linux (Ubuntu 12.04) with an FT2232D wired tp an AT90S2313 in accordance with FTDI’s MPSSE application note AN_135 (which in summary says pins 23->MOSI, 22->MISO, 24->SCK, 21->nRESET).

But I am absolutely baffled as to what port to specify.

I know to use -p avrftdi -p 2313 and be the superuser (until sensible permissions can be assigned anyway).

If I put usb:999 or even complete garbage after the -P I don’t get any kind of meaningful error but does seem to know whether I have the FT2232D plugged in regardless of -P. It looks as if port selection is somehow completely automatic and -P is ignored. What if I have more than one FT2232D ?

I cannot find clear documentation on how to specify the port for accessing this kind of device beyond a mention of usb:N which doesn’t seem to do anything. Maybe I have failed to find the right documentation.

There is a reasonable chance the hardware has a silly mistake as last night was a late one but I would like to know I’ve got the software end right as well so would appreciate some input (and improved documentation for the next person).

Thank you,

Jon


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Jonathan Schneider
I was really using -c avrftdi but didn’t have the sense to paste that in. Sorry about that.

On 15 Jan 2014, at 09:52, I wrote:

> I know to use -p avrftdi -p 2313 and be the superuser (until sensible permissions can be assigned anyway).

Jon


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Hannes Weisbach-2
In reply to this post by Jonathan Schneider

Am 15.01.2014 um 10:52 schrieb Jonathan Schneider <[hidden email]>:
>
> But I am absolutely baffled as to what port to specify.
The FT2232D should work out of the box, if you didn’t change the
VID/PID.
>
> If I put usb:999 or even complete garbage after the -P I don’t get any kind of meaningful error but does seem to know whether I have the FT2232D plugged in regardless of -P. It looks as if port selection is somehow completely automatic and -P is ignored. What if I have more than one FT2232D ?
You need to put the USB VID/PID of your FTDI in hex after -P like so:
'-P 0403:6010‘.  Why did you feel the need to put '-P usb:n‘ in the
avrdude command line?
>
> I cannot find clear documentation on how to specify the port for accessing this kind of device beyond a mention of usb:N which doesn’t seem to do anything. Maybe I have failed to find the right documentation.
I don’t think it’s documented.  I didn’t find it either ;)
>
> There is a reasonable chance the hardware has a silly mistake as last night was a late one but I would like to know I’ve got the software end right as well so would appreciate some input (and improved documentation for the next person).
If it doesn’t work, please provide the *full* avrdude command line,
with all avrdude output, possibly using -vvvv or -vvvvv.

Best regards,
Hannes
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Jonathan Schneider
On 15 Jan 2014, at 13:29, Hannes Weisbach <[hidden email]> wrote:

> Am 15.01.2014 um 10:52 schrieb Jonathan Schneider <[hidden email]>:
>>
>> But I am absolutely baffled as to what port to specify.
> The FT2232D should work out of the box, if you didn’t change the
> VID/PID.
>>
>> If I put usb:999 or even complete garbage after the -P I don’t get any kind of meaningful error but does seem to know whether I have the FT2232D plugged in regardless of -P. It looks as if port selection is somehow completely automatic and -P is ignored. What if I have more than one FT2232D ?
> You need to put the USB VID/PID of your FTDI in hex after -P like so:
> '-P 0403:6010‘.  Why did you feel the need to put '-P usb:n‘ in the
> avrdude command line?

Thank you Hannes. May I suggest the manual be updated ?

Useful to know since my FT2232D board has an EEPROM that is nominally setup like the JTAG section of a Marvell Sheevaplug with different IDs (if it has been programmed properly which it might not have been).

I tried usb:N because the manual page does mention that syntax.

There is still the question of how do deal with having more than one FT2232D present. It’s not a problem for me right now but could be and should be catered for.

Thanks,

Jon


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Hannes Weisbach-2

Am 15.01.2014 um 16:55 schrieb Jonathan Schneider <[hidden email]>:

> On 15 Jan 2014, at 13:29, Hannes Weisbach <[hidden email]> wrote:
>
>> Am 15.01.2014 um 10:52 schrieb Jonathan Schneider <[hidden email]>:
>>>
>>> But I am absolutely baffled as to what port to specify.
>> The FT2232D should work out of the box, if you didn’t change the
>> VID/PID.
>>>
>>> If I put usb:999 or even complete garbage after the -P I don’t get any kind of meaningful error but does seem to know whether I have the FT2232D plugged in regardless of -P. It looks as if port selection is somehow completely automatic and -P is ignored. What if I have more than one FT2232D ?
>> You need to put the USB VID/PID of your FTDI in hex after -P like so:
>> '-P 0403:6010‘.  Why did you feel the need to put '-P usb:n‘ in the
>> avrdude command line?
>
> Thank you Hannes. May I suggest the manual be updated ?
Of course. Please supply a patch ;)
>
> Useful to know since my FT2232D board has an EEPROM that is nominally setup like the JTAG section of a Marvell Sheevaplug with different IDs (if it has been programmed properly which it might not have been).
You can also have a custom avrdude.conf in which you can declare a
custom programmer which 'inherits‘ from avrfrtdi but has a different
VID/PID.  Then you can use that programmer with -c and save the typing
of -P <…>.  If you think other people might benefit from such a new
programmer declaration you can supply a patch for that too.
>
> There is still the question of how do deal with having more than one FT2232D present. It’s not a problem for me right now but could be and should be catered for.
It is.  You can set a serial number in the EEPROM, which avrftdi can
use to select a matching chip.  There should be an option for avrdude
to supply a some sort of "usb serial number“ - but I don’t know which
option it is or whether it is implemented.

Best regards,
Hannes
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Hannes Weisbach-2
>> There is still the question of how do deal with having more than one FT2232D present. It’s not a problem for me right now but could be and should be catered for.
> It is.  You can set a serial number in the EEPROM, which avrftdi can
> use to select a matching chip.  There should be an option for avrdude
> to supply a some sort of "usb serial number“ - but I don’t know which
> option it is or whether it is implemented.
I forgot: You can also set a 'description‘ in the EEPROM which can
also be used by avrftdi to select an FTDI chip.  However, this is
definitely not implemented in avrdude (yet).
>
> Best regards,
> Hannes
> _______________________________________________
> avrdude-dev mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Jonathan Schneider
Here is some output. I have 'scoped it. nRESET, MOSI, and SCK are being
wiggled but I don't see anything on MISO.

Jon
===
jms@jms-eee:~$ lsusb
...
Bus 002 Device 002: ID 0403:6010 Future Technology Devices International,
Ltd FT2232C Dual USB-UART/FIFO IC
jms@jms-eee:~$ uname -a
Linux jms-eee 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:40:43 UTC 2013
i686 i686 i386 GNU/Linux
jms@jms-eee:~$ sudo avrdude -c avrftdi -p 2313 -vvvv -P 0403:6010

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/jms/.avrduderc"
         User configuration file does not exist or is not a regular file,
skipping

         Using Port                    : 0403:6010
         Using Programmer              : avrftdi
avrdude: device: 002, serial number: ? type 0x0500 found
avrdude: Using device VID:PID 0403:6010 type 0x0500(C/D) and SN '?'.
avrdude: Using USB Interface A
avrdude info: reset pin value: 3
avrdude info: direction: 0x0000, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 00 82 00 00
add_pins: 1: 0x0000, inv=0x0000
add_pins: 2: 0x0000, inv=0x0000
add_pin: 7: bit 0x0000 inv=0x0000
add_pin: 8: bit 0x0000 inv=0x0000
add_pin: 9: bit 0x0000 inv=0x0000
add_pin: 10: bit 0x0000 inv=0x0000
pin direction mask: 000b
pin value mask: 0000
avrdude info: clock divisor: 0x0027
avrdude info: Pin is zero val 0!
avrdude info: Pin is zero val 1!
         AVR Part                      : AT90S2313
         Chip Erase delay              : 20000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
          Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------
----- ----- ---------
           eeprom         4    12    64    0 no        128    0      0
 4000  9000 0x80 0x7f
                                  Block Poll               Page
          Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------
----- ----- ---------
           flash          4    12   128    0 no       2048    0      0
 4000  9000 0x7f 0x7f
                                  Block Poll               Page
          Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------
----- ----- ---------
           signature      0     0     0    0 no          3    0      0
0     0 0x00 0x00
                                  Block Poll               Page
          Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------
----- ----- ---------
           fuse           0     0     0    0 no          1    0      0
0     0 0x00 0x00
                                  Block Poll               Page
          Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------
----- ----- ---------
           lock           0     0     0    0 no          1    0      0
 9000  9000 0x00 0x00

         Programmer Type : avrftdi
         Description     : FT2232D based generic programmer

avrdude info: Pin is zero val 0!
avrdude info: Pin is zero val 0!
avrdude info: Pin is zero val 0!
avrdude info: Pin is zero val 0!
avrdude info: pin 0004 bit 0008 value 0x0000
SameVal
avrdude info: Pins is zero!
avrdude info: pin 0001 bit 0001 value 0x0000
SameVal
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0000
avrdude info: direction: 0x000b, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0000
avrdude info: direction: 0x000b, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0000
avrdude info: direction: 0x000b, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0000
avrdude info: direction: 0x000b, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
avrdude info: pin 0004 bit 0008 value 0x0000
avrdude info: direction: 0x000b, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 0b 82 00 00
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude info: Pin is zero val 0!
avrdude info: Pins is zero!
avrdude info: pin 0004 bit 0008 value 0x0008
avrdude info: direction: 0x000b, value: 0x0008, inversion: 0x0000
FTDI LOG: 80 08 0b 82 00 00
LED Mask=0x0000 value =0x0008 &=0x0000
avrdude info: direction: 0x0000, value: 0x0000, inversion: 0x0000
FTDI LOG: 80 00 00 82 00 00

avrdude done.  Thank you.
===
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: avrrftdi driver port selection

Hannes Weisbach-2

Am 17.01.2014 um 10:16 schrieb Jon Schneider <[hidden email]>:

> Here is some output. I have 'scoped it. nRESET, MOSI, and SCK are being wiggled but I don't see anything on MISO.
Ok.  You can use -b to set the frequency.  The default is 150kHz,
which is usually unproblematic, but bad cabling may require a slower
connection.  Give -b 10000 a try.  Also use short cables and a low
inductance ground return.

How (fast) is the ATtiny clocked?  Beware that the SPI-frequency must
be (well) below of 1/4 of the oscillator frequency.

Best regards,
Hannes
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev