[RESOLVED] Re: timeouts on USB ISP programmer

From: Axel Rau <Axel.Rau_at_Chaos1.DE>
Date: Thu, 21 Apr 2022 17:05:19 UTC
Hi Hans, Tomek, all

Am 07.04.22 um 13:33 schrieb Axel Rau:
> my DIAMEX-AVR-USB gets timeouts while talking to the target:
> - - -

With the trace, recorded by Joerg Wunsch (author of avrdude),
Hans found the implementation bug in the device.
He wrote to Joerg:
====
I see from the Ellisys .png's what is wrong. The device doesn't support
resetting the data-toogle (CLEAR ENDPOINT HALT) which is a mandatory USB
control endpoint command. So the USB stack tries a couple of times and then
gives up and resets the device!

The device is not USB.org class compliant! :-(

Probably setting:

sysctl hw.usb.no_cs_fail=1

may help.
====
Indeed with this setting the device works perfectly:
- - -
root@home2l:/usr/local/home2l/share/brownies # avrdude -c stk500v2 \
	-p t85 -P /dev/cuaU0  \
	-U hfuse:w:init.t85.elf \
	-U efuse:w:init.t85.elf \
	-U eeprom:w:init.t85.elf \
	-U flash:w:init.t85.elf

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be 
performed
          To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "init.t85.elf"
avrdude: input file init.t85.elf auto detected as ELF
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against init.t85.elf:
avrdude: load data hfuse data from input file init.t85.elf:
avrdude: input file init.t85.elf auto detected as ELF
avrdude: input file init.t85.elf contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "init.t85.elf"
avrdude: input file init.t85.elf auto detected as ELF
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against init.t85.elf:
avrdude: load data efuse data from input file init.t85.elf:
avrdude: input file init.t85.elf auto detected as ELF
avrdude: input file init.t85.elf contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "init.t85.elf"
avrdude: input file init.t85.elf auto detected as ELF
avrdude: writing eeprom (50 bytes):

Writing | ################################################## | 100% 0.07s

avrdude: 50 bytes of eeprom written
avrdude: verifying eeprom memory against init.t85.elf:
avrdude: load data eeprom data from input file init.t85.elf:
avrdude: input file init.t85.elf auto detected as ELF
avrdude: input file init.t85.elf contains 50 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 50 bytes of eeprom verified
avrdude: reading input file "init.t85.elf"
avrdude: input file init.t85.elf auto detected as ELF
avrdude: writing flash (1976 bytes):

Writing | ################################################## | 100% 0.86s

avrdude: 1976 bytes of flash written
avrdude: verifying flash memory against init.t85.elf:
avrdude: load data flash data from input file init.t85.elf:
avrdude: input file init.t85.elf auto detected as ELF
avrdude: input file init.t85.elf contains 1976 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.71s

avrdude: verifying ...
avrdude: 1976 bytes of flash verified

avrdude: safemode: Fuses OK (E:FE, H:D7, L:62)

avrdude done.  Thank you.
- - -
diamex.de has been notified about the bug.

Man thanks to all, who responded, especially Hans and Tomek,
Axel
-- 
PGP-Key: CDE74120  ☀  computing @ chaos claudius