Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Apr 2022 05:33:22 +0200
From:      Tomek CEDRO <tomek@cedro.info>
To:        hardware@freebsd.org
Cc:        Hans Petter Selasky <hps@selasky.org>, Axel Rau <Axel.Rau@chaos1.de>
Subject:   Re: timeouts on USB ISP programmer
Message-ID:  <CAFYkXjmf8DpZw5hQ6Cc_FBurHufKNHhKGYiXpK%2BArB0SGCbqsg@mail.gmail.com>
In-Reply-To: <CAFYkXjnbneNUszR8ZwS50xY8924uvCQyYQ9d3ohT_t1HZrjmDw@mail.gmail.com>
References:  <3A781DFA-1E2C-41A5-8053-C90A806244DC@Chaos1.DE> <34a747ea-2ee5-660f-71c6-dc00d5de337f@selasky.org> <9334c4f0-3ecf-c046-420f-516e39379981@selasky.org> <976BDBEB-8B57-4541-A0B7-3F2C89498DC6@Chaos1.DE> <7190bdde-22bc-79ee-06d0-d0114a3ffbad@selasky.org> <CAFYkXj=HMdxZG%2B8x0gpLCDy8cbu_qOpFqcN37RO9EG=WOBHkqw@mail.gmail.com> <CAFYkXjmjnFX1a3%2BCQxAxdwX=-oASSEWLdzrmx=%2B4QbX3_Og2Gw@mail.gmail.com> <CAFYkXjmgLi0F4gLVWQxtVwS6tCXCni%2BxU2-7KQM4ve%2B%2B-aEiBw@mail.gmail.com> <CAFYkXjnG5uOzF5_BbNZUgzBzTN8hpU9RmTTh1h_KDZ0EonZgEQ@mail.gmail.com> <CAFYkXjnbneNUszR8ZwS50xY8924uvCQyYQ9d3ohT_t1HZrjmDw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mystery solved ;-)

For avrdude `-P` parameter defines the the programmer port __BUT__ (as
obviously stated in man page) if you use `usb:` device then you need
to provide programmer SERIAL NUMBER last bytes not the OS serial port
device ;-)

If you run avrdude with `-vvv` switch then you get increased
verbosity. It will tell you what it found. You will notice that it
found a device that matches VID:PID pair but not Serial NUMBER of the
device (not the port) ;-)

Details here: https://github.com/avrdudes/avrdude/issues/920

Because avrdude keeps all its Programmer and Target definitions in a
configuration file it is possible to define completely new Programmer
and Target MCU with a simple commands in `~/.avrduderc` (see
`/usr/local/etc/avrdude.conf` for reference).

It is also possible to build the port with `cd
/usr/ports/devel/avrdude; make WITH_DEBUG=1; make reinstall` to obtain
binary that can be easily debugged with `lldb` (btw I just discovered
`gui` option). `usbhid_open()` and/or `usbdev_open()` is the place
where VID:PID and serial is handled.

I hope that helps move things forward :-)

Tomek


% avrdude -c xplainedmini -p t416 -P usb:3537 -vvv

avrdude: Version 6.4
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/home/XXX/.avrduderc"

         Using Port                    : usb:3537
         Using Programmer              : xplainedmini
avrdude: stk500v2_jtag3_open()
avrdude: usbhid_open(): Found mEDBG CMSIS-DAP, serno: ATML2795042700003537
avrdude: usbhid_open(): Opening path 0-3.4.4:1.0
avrdude: usbhid_open(): Probing for max. packet size
avrdude: usbhid_open(): Setting max_xfer from DAP_Info response to 64
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_getsync()
avrdude: Sending sign-on command:
avrdude: jtag3_edbg_send(): sending 3 bytes
avrdude: jtag3_recv(): Got message seqno 0 (command_sequence == 0)

[general] OK
         AVR Part                      : ATtiny416
         Chip Erase delay              : 0 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 0
         StabDelay                     : 0
         CmdexeDelay                   : 0
         SyncLoops                     : 0
         ByteDelay                     : 0
         PollIndex                     : 0
         PollValue                     : 0x00
         Memory Detail                 :


-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjmf8DpZw5hQ6Cc_FBurHufKNHhKGYiXpK%2BArB0SGCbqsg>