From nobody Fri Apr 8 03:33:22 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 34FEE1A804D5 for ; Fri, 8 Apr 2022 03:33:37 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) (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 4KZP3h2Cqxz4VkW for ; Fri, 8 Apr 2022 03:33:36 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-e2442907a1so8143975fac.8 for ; Thu, 07 Apr 2022 20:33:36 -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; bh=fPRwl/Uxp5bBEzPn/CjmDmk/ivWZyX/NbPOmJHSvcH0=; b=DKeNs26xt+wAPeANkaqKyD+9Swao3tE84F1mXh0IyV0cm7NESoOti/HZ420OpW37ZS K+z0Bwan5emGHs4KFxrJnwX1cJlmW4pxvPZoqFf5r7SOrQj7GToyrcFvo7Joywrnl1s4 scHKXB2IWXXvsmrK88Vb+QynlieeLVSFWrwWtcxzc9pCHY6v1B9zzSCV7LcvioOrnkQS m3NzD2qx3fLg6EaAvQzxTUUOfMW5YQ8vokvhLBPYm2mMWTNevlLDfGfF6d5teqyOO6Eq KG2GEQzz/3sduwvwMQwWOoIfs6LxR9iUuO7KsE2nIGlSjK9YfMbslybPOsy5z/V/Uwit oYdg== 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; bh=fPRwl/Uxp5bBEzPn/CjmDmk/ivWZyX/NbPOmJHSvcH0=; b=huMhY2C1AzP0jpyWNBlgzZxzHyGlmJy6/55IoFzpMsOHW0RNV6APFA9xxF5/NJPuxG f1lC+oPJ+oUJZ7F0GiuuNS+be01sHUeYHsnEZcl926UypOygxee+16XEoX/1iV9OQLR/ JtfXdPuPBcQXGls5tDdqaAHCKTM/RC8m5OcQ7DIfFS94GQ7NZgh5SA3am6j54jXogVWG yEehds22LJjtPcK5ed+7p07LJua0QCDzHZok2M26QieokeGdgshM6HRENvErBLXBmC3e tyAdARJhrEbxvs0mvhbhWc0AfWkYwqMUfBRTLhkREasXicEV1tn4tvBvbzNeNE11hj+s ln8Q== X-Gm-Message-State: AOAM53368rzeYPa1Uc7TFvXSNbimO5RTuLc2/osnjSEVGBmoLHzPby0n ygTI+ypn2QEGpGRFmE2NWBO3pCbIJAP8PNqi X-Google-Smtp-Source: ABdhPJyx7ECR2XbbrTHn/291tUTiNH20W5itimO1F43Uy8gruWe5D8b4UL+WzdT+sP9Po/8jlCFXpQ== X-Received: by 2002:a05:6870:4601:b0:d7:446:3525 with SMTP id z1-20020a056870460100b000d704463525mr7820445oao.13.1649388815286; Thu, 07 Apr 2022 20:33:35 -0700 (PDT) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com. [209.85.210.43]) by smtp.gmail.com with ESMTPSA id s65-20020acac244000000b002ef4ee8c800sm8180858oif.13.2022.04.07.20.33.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 20:33:35 -0700 (PDT) Received: by mail-ot1-f43.google.com with SMTP id k25-20020a056830151900b005b25d8588dbso5285929otp.4 for ; Thu, 07 Apr 2022 20:33:34 -0700 (PDT) X-Received: by 2002:a9d:2c42:0:b0:5cd:9e86:44c2 with SMTP id f60-20020a9d2c42000000b005cd9e8644c2mr6121772otb.250.1649388814474; Thu, 07 Apr 2022 20:33:34 -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> In-Reply-To: From: Tomek CEDRO Date: Fri, 8 Apr 2022 05:33:22 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: timeouts on USB ISP programmer To: hardware@freebsd.org Cc: Hans Petter Selasky , Axel Rau Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4KZP3h2Cqxz4VkW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=DKeNs26x; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2001:4860:4864:20::36) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-2.15 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-0.99)[-0.994]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; 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_SPAM_LONG(0.13)[0.130]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.43:received,2001:4860:4864:20::36:from]; NEURAL_HAM_SHORT(-0.98)[-0.984]; 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:2001:4860:4864::/48, country:US]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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