From nobody Sun Apr 10 15:01:20 2022 X-Original-To: hardware@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D6ADD1AAC5BB for ; Sun, 10 Apr 2022 15:01:36 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KbwDb3vltz3N3t for ; Sun, 10 Apr 2022 15:01:34 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-ot1-x32e.google.com with SMTP id n19-20020a9d7113000000b005cd9cff76c3so9641232otj.1 for ; Sun, 10 Apr 2022 08:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=T2JmXuVatqhDQcq65BvQbaZuZwW5JSC7vV7RuqSJ94w=; b=hdY32z61IjxlIFaB3ic7uqIlDFiqx+ow8jyePwoPCPdSzStZZur+9ht/2NKBRU/faL Gc6URIH6aVRiVVqT2NED66u+yRpYlX+BhlCtP61M8KDWgOhEUqZj21Im8ITu5lGdCB/8 l+caGVBLCFXayHEUZTnLRLk2mBeH/OSXDhxvKKrfWdb/t5X5WMd5SQH/0WXb5Pz/l457 z96P6cHZDYdRcyLMUsFrG3AKrMgG5RYOwgnJbqTwSqAIqaKOnM7tAqvE2cJquD1YBcxd NYeGmKHd+Eg0mO/8IfLoNMdmmMEZaUdtohbOAXZ+X/HO3YFYg2OBgblQGO8Wxw3Ex9Um qTPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=T2JmXuVatqhDQcq65BvQbaZuZwW5JSC7vV7RuqSJ94w=; b=NGqd3bA5NUHtByws7yOGk8Dg1pOp2ytPynTkLB1k4+Hjj9HFXgpc7ui7lZJ/XE/Rjk hsdvPbXkcAsn3Z5/bfUsgzUUWWcOrWSh5yEtGWYRrvsfMVUsLnHIeICIojYb7ZQMlzDr pFl/WGY22Ff9klf6iPVUI0PfW4Y3pCz3FQd4V7B/s6zyDPBckDudrgFZG7is0nbHqOm1 UAbI9DxxB1nTB2TYIOx3Z0y/uc23gWppwAQHL4A2ybgHih7xeLiYp108mA/mC+dbv+Nt JFMyfcckYUtXMr3bPTCXosng+tiv5OJVJ/VpWttjGdE6vATfp8mXomXpnu6KY1/aEiqm fKAg== X-Gm-Message-State: AOAM5304AlLHxlbd8BidSlNl0/+4mZugMUSuboIZaC+IeXFJ1iYQ97gj GoDPBzXMjFIWbbzLGBmrJ/tVeWaNvfh4exf7 X-Google-Smtp-Source: ABdhPJyYKfmANaxNdOzmiZNjRUmPgs+aMpqc+3IwrjoPEVOWMXHnQJxVCBzFFzZgsZlz3SzuWqb0sg== X-Received: by 2002:a9d:3ad:0:b0:5c9:297f:b20b with SMTP id f42-20020a9d03ad000000b005c9297fb20bmr9737535otf.234.1649602894037; Sun, 10 Apr 2022 08:01:34 -0700 (PDT) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com. [209.85.210.48]) by smtp.gmail.com with ESMTPSA id y17-20020a056870429100b000e2a837639fsm1578795oah.4.2022.04.10.08.01.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Apr 2022 08:01:33 -0700 (PDT) Received: by mail-ot1-f48.google.com with SMTP id c18-20020a056830001200b005e6ed2a21c9so231178otp.8 for ; Sun, 10 Apr 2022 08:01:33 -0700 (PDT) X-Received: by 2002:a9d:2c42:0:b0:5cd:9e86:44c2 with SMTP id f60-20020a9d2c42000000b005cd9e8644c2mr10062269otb.250.1649602893122; Sun, 10 Apr 2022 08:01:33 -0700 (PDT) List-Id: General discussion of FreeBSD hardware List-Archive: https://lists.freebsd.org/archives/freebsd-hardware List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hardware@freebsd.org MIME-Version: 1.0 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> <7CDFB049-241F-4C31-A7B1-A7D6BDE6A002@Chaos1.DE> <24AA646A-698B-4D41-9668-3F9F99732D02@Chaos1.DE> <1A94816D-E3C1-4488-A5A9-784BAC68AE74@Chaos1.DE> In-Reply-To: From: Tomek CEDRO Date: Sun, 10 Apr 2022 17:01:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: timeouts on USB ISP programmer To: Axel Rau Cc: Hans Petter Selasky , hardware@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4KbwDb3vltz3N3t X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=hdY32z61; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2607:f8b0:4864:20::32e) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[hardware@freebsd.org]; DMARC_NA(0.00)[cedro.info]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32e:from,209.85.210.48:received]; MLMMJ_DEST(0.00)[hardware]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 10, 2022 at 12:37 PM Axel Rau wrote: > Am 09.04.2022 um 01:39 schrieb Tomek CEDRO : > > 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