Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2022 17:01:20 +0200
From:      Tomek CEDRO <tomek@cedro.info>
To:        Axel Rau <Axel.Rau@chaos1.de>
Cc:        Hans Petter Selasky <hps@selasky.org>, hardware@freebsd.org
Subject:   Re: timeouts on USB ISP programmer
Message-ID:  <CAFYkXj=w6aTh8LGy_aE26fB-1brjgEHr_VRfugggBP5FmooNow@mail.gmail.com>
In-Reply-To: <FF735DA2-B675-4E3D-B247-E1E3CAD735CF@Chaos1.DE>
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> <CAFYkXjmf8DpZw5hQ6Cc_FBurHufKNHhKGYiXpK%2BArB0SGCbqsg@mail.gmail.com> <7CDFB049-241F-4C31-A7B1-A7D6BDE6A002@Chaos1.DE> <CAFYkXjnwvba60u3_tRMReEiyb5dohNZDLoenZWieNB2q_c_-0w@mail.gmail.com> <24AA646A-698B-4D41-9668-3F9F99732D02@Chaos1.DE> <CAFYkXjk2TgdC65j1YZqYw2AHn2zMVR2uZ52NTF8jTGVPRV60sg@mail.gmail.com> <1A94816D-E3C1-4488-A5A9-784BAC68AE74@Chaos1.DE> <CAFYkXjkCZopGV2vOEtzNg_Ut76WuyHQ5NxxVOjoY-Sy-QNuGHw@mail.gmail.com> <FF735DA2-B675-4E3D-B247-E1E3CAD735CF@Chaos1.DE>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 10, 2022 at 12:37 PM Axel Rau <Axel.Rau@chaos1.de> wrote:
> Am 09.04.2022 um 01:39 schrieb Tomek CEDRO <tomek@cedro.info>:
> > Long story short:
> > * Put both dip-switches to OFF if you use external board (no VCC
> > connection required). They may stay ON if you program "bare" AVR (you
> > need to connect VCC, SW1=3DON, SW2 OFF=3D3.3V ON=3D5V).
>
> My switches are always on; my MCU is in the ZIFF socket. (-:

Okay ZIF, good :-) 5V is required for programing from what I read from
datasheet.


> > * Try `avrdude -c stk500v2 -p 85 -vvv -t` and see of that connects to
> > Programmer.
>
> That=E2=80=99s what I did.
>
> root@home2l:/ # avrdude -c stk500v2 -p t85 -P /dev/cuau1 -t -vvv -B 250 -=
i 90
> . . .
> 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 "/root/.avrduderc"
>          User configuration file does not exist or is not a regular file,=
 skipping
>
>          Using Port                    : /dev/cuau1
>          Using Programmer              : stk500v2
>          Setting bit clk period        : 250.0
>          Setting isp clock delay        :  90
> avrdude: ser_recv(): programmer is not responding
> avrdude: stk500v2_ReceiveMessage(): timeout
> avrdude: ser_recv(): programmer is not responding
> avrdude: stk500v2_ReceiveMessage(): timeout
> avrdude: ser_recv(): programmer is not responding
> avrdude: stk500v2_ReceiveMessage(): timeout

Not exactly what I wrote. You used again `-P /dev/cuau1` which is
INVALID syntax. Use no `-P` at all.

STEP 1:

Get a connection to the programmer:

avrdude -c stk500v2 -p 85 -vvv -t

Nothing more. You should get a connection to the Programmer.


STEP 2:

Get Programmer talking with PC by setting serial port BAUDRATE (-b).

For that you may need to set `-b` (baudrate, not SMALL b). You can
attach serial terminal program like `minicom` and set various port
baudrates to see when you get a readable response (i.e. 9600, 57600,
115200, etc). For instance with ATtiny104XNANO I had to use `-b 9600`
parameter.

avrdude -c stk500v2 -p 85 -vvv -t -b 9600

You must end this step with working Programmer talking fine to avrdude.


STEP 3:

Set talking to AVR speed (BITCLOCK -B parameter).

If Diamex works fine with avrdude, but you cannot program AVR, you may
need to tune bitclock with `-B` (note BIG B). You can use frequency
suffix here (i.e. 40khz, 100khz). Try slower and faster speeds.

Example: avrdude -c stk500v2 -p 85 -vvv -B 100khz


That should make it. Assuming STK500V2 will use DebugWIRE ;-)


> I think, the DIAMEX is defective, I try to get another one.
> Perhaps the drivers are gone.
>
> How can I verify this?

Well this avrdude is not that easy to use as it turns out at first
steps even for me so do not worry just try until it works ;-)

It turns out my ATtiny104XNANO does not support TPI protocol so I
cannot program ATtiny10. I am writing now configuration for FT2232H
based KT-LINK. Oscilloscope is mandatory here. I guess you can verify
your Diamex with oscilloscope too.

Here is the detailed deocumentation of avrdude:
https://quantum-mirror.hu/mirrors/pub/gnusavannah/avrdude/avrdude-doc-6.4.p=
df

Here is the PR for fixing the build out-of-the-box on FreeBSD:
https://github.com/avrdudes/avrdude/pull/925


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXj=w6aTh8LGy_aE26fB-1brjgEHr_VRfugggBP5FmooNow>