0

unable to enumerate USB device, persistent enumeration fail
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

unable to enumerate USB device, persistent enumeration fail

by fessyfoo on Sun Apr 23, 2017 10:11 pm

HI. got my USBTinyISP kit. soldered it together, plugged it in and it's not being recognized. system messages indicate it's failing to enumerate. I'd appreciate any help to get this working. it's my first programmer. I thought I'd do it the hard way. I'm getting my wish. :D

I tried on ubuntu14.04 (usb 2.0 port) and OSX El Capitan (both usb 3.0 port and through a USB 2.0 hub) I also used two different cables with the same results.
I double checked that all the diodes, leds, capacitors, are in the correct direction. the chips as well. I verified pin 20 on the attiny has 5v when plugged in to usb.

i didn't have chip connected but i tried running avrdude per the suggestion in the documentation that osx 3.0 port won't turn on the green light until avrdude communicates. (however I assume successful usb enumeration is required first? ) anyhow it didn't help:
Code: Select all | TOGGLE FULL SIZE
fess@otfess-1028% avrdude -c usbtiny -p m8
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

avrdude done.  Thank you.


the following are the system messages that to me indicate the device is starting to act as usb, but then failing:

ubuntu 14.04 /var/log/kern.log
Code: Select all | TOGGLE FULL SIZE
Apr 22 23:35:32 sneech kernel: [5374599.683330] usb 2-8: new low-speed USB device number 6 using ohci-pci
Apr 22 23:35:32 sneech kernel: [5374599.867393] usb 2-8: device descriptor read/64, error -62
Apr 22 23:35:32 sneech kernel: [5374600.151681] usb 2-8: device descriptor read/64, error -62
Apr 22 23:35:33 sneech kernel: [5374600.431816] usb 2-8: new low-speed USB device number 7 using ohci-pci
Apr 22 23:35:33 sneech kernel: [5374600.615943] usb 2-8: device descriptor read/64, error -62
Apr 22 23:35:33 sneech kernel: [5374600.904139] usb 2-8: device descriptor read/64, error -62
Apr 22 23:35:33 sneech kernel: [5374601.184394] usb 2-8: new low-speed USB device number 8 using ohci-pci
Apr 22 23:35:34 sneech kernel: [5374601.592643] usb 2-8: device not accepting address 8, error -62
Apr 22 23:35:34 sneech kernel: [5374601.769353] usb 2-8: new low-speed USB device number 9 using ohci-pci
Apr 22 23:35:34 sneech kernel: [5374602.177095] usb 2-8: device not accepting address 9, error -62
Apr 22 23:35:34 sneech kernel: [5374602.177434] hub 2-0:1.0: unable to enumerate USB device on port 8



osx 10.11.6 /var/log/system.log
Code: Select all | TOGGLE FULL SIZE
Apr 23 17:27:29 otfess kernel[0]: 036416.842344 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:31 otfess kernel[0]: 036418.076895 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:32 otfess kernel[0]: 036419.443355 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:34 otfess kernel[0]: 036421.075084 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:36 otfess kernel[0]: 036423.237883 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:38 otfess kernel[0]: 036425.279783 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:43 otfess kernel[0]: 036430.262672 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:51 otfess kernel[0]: 036438.145972 HS05@14200000: AppleUSB20XHCIPort::resetAndCreateDevice: failed to create device, disabling port
Apr 23 17:27:51 otfess kernel[0]: 036438.145997 HS05@14200000: AppleUSBHostPort::disconnect: persistent enumeration failures


osx /var/log/system.log when using usb 2.0 hub (my keyboard)
Code: Select all | TOGGLE FULL SIZE
Apr 23 18:31:24 otfess kernel[0]: 039856.799347 AppleUSB20HubPort@14240000: AppleUSBHostPort::disconnect: persistent enumeration failures


here's photos of my build in case there's anything to spot.

IMG_1837.jpg
IMG_1837.jpg (858.21 KiB) Viewed 1603 times

IMG_1835.jpg
IMG_1835.jpg (703.42 KiB) Viewed 1603 times


Thanks for reading this far!
Last edited by fessyfoo on Mon Apr 24, 2017 10:20 am, edited 1 time in total.

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: USBTinyISP not enumerating.

by franklin97355 on Sun Apr 23, 2017 11:25 pm

Soldering looks good but I'm not an Apple person so I'll check.

franklin97355
 
Posts: 20139
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Tue Apr 25, 2017 3:15 pm

I have tried again having actually wired up an ATtiny85 for programming in case that made a difference. it didn't seem to work.

thoughts on how to diagnose where the issue lies?

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by Russell 27 on Tue Apr 25, 2017 4:15 pm

Do you have all programming tools installed on El Capitan. I used crosspack avr installer(includes all tools) on both Mavericks and El Capitan, with both USB2 and USB3, no problems. Someone else had the exact same problem as you, few days ago. Do you have another programmer to check fuses and flash on attiny 2313. Might be worth a look if everything else is right. Build looks real good.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Tue Apr 25, 2017 10:24 pm

I don't have another programmer. this is my first.

That's encouraging you have it working on osx. thanks!

i have osx-cross via homebrew. avr-gcc and avrdude

The device also didn't enumerate on my linux ubuntu14.04 box. Correct me if I'm wrong, but, I don't think I should need any tools installed for it to show up to the kernel and enumerate. I can try installing the tools in linux, and see what happens.

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by Russell 27 on Wed Apr 26, 2017 8:42 am

While the Mac doesn't have a driver like Windows, certain defines need to be correct. If you want to build your own toolchain I understand, but if something isn't quite right, this could be your issue. Take a look at this adafruit tutorial for some of the issues. Crosspack AVR is fully built, with all tools included, ready to go. This has been completely stable and reliable on an early 2011, mid 2012 and mid 2014 MacBook pro, with different versions of OS and both USB2 and USB3. I just have to select path in terminal to desired programming folder.

Example >> cd /Users/russell/Program_folder/
press enter, then you can use your make file or whatever

To use make command you need programming tools installed, don't need complete XCODE.

You may already know some of these things.

Tools included in Crosspack AVR

avarice: 2.13
avr-binutils: 2.23.2
avr-gcc: 4.8.1
avr-libc: 1.8.0
avrdude: 6.0.1
gdb: 7.6.1
libusb: 0.1.12
make: 4.0
simulavr: 0.1.2.7

Never had an issue with this setup and programmer communication.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: unable to enumerate USB device, persistent enumeration

by Russell 27 on Wed Apr 26, 2017 4:10 pm

System Information.png
System Information.png (219.36 KiB) Viewed 1516 times


One last thing. This image is from System Information > Hardware > USB. When usbtiny is plugged in, under USB >> USB Device Tree/Vendor-Specific Device is shown. Product ID: 0X0c9f and Vendor ID: 0X1781 are Adafruit Vendor numbers for usbtiny device. Same ones are in Firmware > SPI > config.h programming files. If you can’t find this with device plugged in, you have a problem.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Wed Apr 26, 2017 10:57 pm

Yep, the device never shows up in the usb device tree. which lead me to the logs. which show the device isn't enumerating, (see original post)

similarly on linux, the kernel messages show it not enumerating, and lsusb doesn't show it.

I assume this means there's not a problem with software on the host, because i haven't gotten that far. but will try installing crosspack via the download and dmg instead of homebrew.
Attachments
Untitled.png
Untitled.png (69.48 KiB) Viewed 1506 times

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Fri Apr 28, 2017 1:15 am

On ubuntu 14.04 I followed a procedure in this doc: https://www.kernel.org/doc/Documentation/usb/usbmon.txt

to try and sniff usb. I did see this burst of data. but despite reading the above doc, I'm having trouble telling what is happening.
I _think_ the device is just not responding.

here's the usbmon dump in case it makes sense to anyone else:

Code: Select all | TOGGLE FULL SIZE
ffff88013e7ebcc0 75547059 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
ffff88013e7ebcc0 75547111 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547121 S Ci:1:001:0 s a3 00 0000 0002 0004 4 <
ffff88013e7ebcc0 75547127 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547135 S Ci:1:001:0 s a3 00 0000 0003 0004 4 <
ffff88013e7ebcc0 75547142 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547147 S Ci:1:001:0 s a3 00 0000 0004 0004 4 <
ffff88013e7ebcc0 75547154 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547158 S Ci:1:001:0 s a3 00 0000 0005 0004 4 <
ffff88013e7ebcc0 75547164 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547169 S Ci:1:001:0 s a3 00 0000 0006 0004 4 <
ffff88013e7ebcc0 75547174 C Ci:1:001:0 0 4 = 00010000
ffff88013e7ebcc0 75547178 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7ebcc0 75547195 C Ci:1:001:0 0 4 = 01050100
ffff88013e7ebcc0 75547200 S Co:1:001:0 s 23 01 0010 0007 0000 0
ffff88013e7ebcc0 75547207 C Co:1:001:0 0 0
ffff88013e7ebcc0 75547212 S Ci:1:001:0 s a3 00 0000 0008 0004 4 <
ffff88013e7ebcc0 75547218 C Ci:1:001:0 0 4 = 00010000
ffff88021f7d80c0 75648045 S Ii:1:001:1 -115:2048 4 <
ffff8801a8937000 75648099 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937000 75648122 C Ci:1:001:0 0 4 = 01050000
ffff88013e7ebcc0 75648161 S Co:1:001:0 s 23 03 0004 0007 0000 0
ffff88021f7d80c0 75648213 C Ii:1:001:1 0:2048 2 = 8000
ffff88021f7d80c0 75648215 S Ii:1:001:1 -115:2048 4 <
ffff88013e7ebcc0 75648233 C Co:1:001:0 0 0
ffff88021f7d80c0 75652015 C Ii:1:001:1 0:2048 2 = 8000
ffff88021f7d80c0 75652036 S Ii:1:001:1 -115:2048 4 <
ffff8801a8937840 75703989 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937840 75704045 C Ci:1:001:0 0 4 = 00010100
ffff88011925be40 75704073 S Co:1:001:0 s 23 01 0014 0007 0000 0
ffff88011925be40 75704097 C Co:1:001:0 0 0
ffff8801a89373c0 75704117 S Co:1:001:0 s 23 01 0001 0007 0000 0
ffff8801a89373c0 75704128 C Co:1:001:0 0 0
ffff88011925b6c0 75704154 S Co:1:001:0 s 23 01 0001 0007 0000 0
ffff88011925b6c0 75704165 C Co:1:001:0 0 0
ffff8801a8937300 75704186 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937300 75704201 C Ci:1:001:0 0 4 = 00010100
ffff88011925b6c0 75704215 S Co:1:001:0 s 23 01 0010 0007 0000 0
ffff88011925b6c0 75704226 C Co:1:001:0 0 0
ffff8801a89379c0 75704240 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a89379c0 75704249 C Ci:1:001:0 0 4 = 00010000
ffff8801a89376c0 75724014 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
ffff8801a89376c0 75724042 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724046 S Ci:2:001:0 s a3 00 0000 0002 0004 4 <
ffff8801a89376c0 75724051 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724053 S Ci:2:001:0 s a3 00 0000 0003 0004 4 <
ffff8801a89376c0 75724057 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724059 S Ci:2:001:0 s a3 00 0000 0004 0004 4 <
ffff8801a89376c0 75724063 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724065 S Ci:2:001:0 s a3 00 0000 0005 0004 4 <
ffff8801a89376c0 75724069 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724070 S Ci:2:001:0 s a3 00 0000 0006 0004 4 <
ffff8801a89376c0 75724074 C Ci:2:001:0 0 4 = 00010000
ffff8801a89376c0 75724076 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a89376c0 75724080 C Ci:2:001:0 0 4 = 01030100
ffff8801a89376c0 75724082 S Co:2:001:0 s 23 01 0010 0007 0000 0
ffff8801a89376c0 75724084 C Co:2:001:0 0 0
ffff8801a89376c0 75724087 S Ci:2:001:0 s a3 00 0000 0008 0004 4 <
ffff8801a89376c0 75724091 C Ci:2:001:0 0 4 = 00030000
ffff88021f110000 75736010 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff88021f110000 75736038 C Ci:1:001:0 0 4 = 00010000
ffff88011925be40 75768053 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff88011925be40 75768101 C Ci:1:001:0 0 4 = 00010000
ffff88013e7eb6c0 75800012 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7eb6c0 75800063 C Ci:1:001:0 0 4 = 00010000
ffff88021f7e6000 75828006 S Ii:2:001:1 -115:128 2 <
ffff88013e7eb3c0 75832014 S Ci:1:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7eb3c0 75832064 C Ci:1:001:0 0 4 = 00010000
ffff8801a8937180 75832103 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff88021f7d80c0 75832133 C Ii:1:001:1 -2:2048 0
ffff8801a8937180 75832137 C Ci:2:001:0 0 4 = 01030000
ffff88013e7eb300 75832173 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88021f7e6000 75843080 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 75843097 S Ii:2:001:1 -115:128 2 <
ffff88013e7eb300 75896029 C Co:2:001:0 0 0
ffff8801a89376c0 75952043 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a89376c0 75952093 C Ci:2:001:0 0 4 = 03031000
ffff88021f7e6000 75988027 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 75988045 S Ii:2:001:1 -115:128 2 <
ffff8802220a6900 76007967 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff8802220a6900 76007998 C Co:2:001:0 0 0
ffff8801a89373c0 76008056 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a89373c0 76010046 C Ci:2:000:0 -62 0
ffff8801a89373c0 76010090 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a89373c0 76013052 C Ci:2:000:0 -62 0
ffff8801a89373c0 76013117 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a89373c0 76016042 C Ci:2:000:0 -62 0
ffff8801a89373c0 76016082 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff8801a89373c0 76080036 C Co:2:001:0 0 0
ffff88000df9dcc0 76136039 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff88000df9dcc0 76136095 C Ci:2:001:0 0 4 = 03031000
ffff8802220a6240 76191965 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff8802220a6240 76191979 C Co:2:001:0 0 0
ffff8801a8937000 76296029 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a8937000 76298030 C Ci:2:000:0 -62 0
ffff8801a8937000 76298067 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a8937000 76301040 C Ci:2:000:0 -62 0
ffff8801a8937000 76301105 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff8801a8937000 76304040 C Ci:2:000:0 -62 0
ffff8801a8937000 76304106 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88021f7e6000 76315080 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 76315111 S Ii:2:001:1 -115:128 2 <
ffff8801a8937000 76368010 C Co:2:001:0 0 0
ffff8801a8937000 76424036 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937000 76424068 C Ci:2:001:0 0 4 = 03031000
ffff88013e7eb300 76480053 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff88013e7eb300 76480118 C Co:2:001:0 0 0
ffff8802220a6240 76584053 S Co:2:001:0 s 23 01 0001 0007 0000 0
ffff8802220a6240 76584091 C Co:2:001:0 0 0
ffff88013e7ebcc0 76584142 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88021f7e6000 76595063 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 76595084 S Ii:2:001:1 -115:128 2 <
ffff88013e7ebcc0 76648050 C Co:2:001:0 0 0
ffff88013e7eb600 76704001 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7eb600 76704051 C Ci:2:001:0 0 4 = 03031000
ffff88021f7e6000 76732049 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 76732071 S Ii:2:001:1 -115:128 2 <
ffff8802220a6900 76760035 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff8802220a6900 76760070 C Co:2:001:0 0 0
ffff88013e7eba80 76760119 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eba80 76762013 C Ci:2:000:0 -62 0
ffff88013e7eba80 76762039 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eba80 76765022 C Ci:2:000:0 -62 0
ffff88013e7eba80 76765083 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eba80 76768024 C Ci:2:000:0 -62 0
ffff88013e7eba80 76768087 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88013e7eba80 76832057 C Co:2:001:0 0 0
ffff88013e7eb3c0 76888000 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7eb3c0 76888050 C Ci:2:001:0 0 4 = 03031000
ffff88000df9db40 76944042 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff88000df9db40 76944088 C Co:2:001:0 0 0
ffff88013e7eb3c0 77048017 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eb3c0 77050012 C Ci:2:000:0 -62 0
ffff88013e7eb3c0 77050075 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eb3c0 77052999 C Ci:2:000:0 -62 0
ffff88013e7eb3c0 77053050 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
ffff88013e7eb3c0 77056015 C Ci:2:000:0 -62 0
ffff88013e7eb3c0 77056077 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88021f7e6000 77067030 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 77067045 S Ii:2:001:1 -115:128 2 <
ffff88013e7eb3c0 77120033 C Co:2:001:0 0 0
ffff88013e7eba80 77176037 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff88013e7eba80 77176077 C Ci:2:001:0 0 4 = 03031000
ffff88021f7e6000 77228009 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 77228029 S Ii:2:001:1 -115:128 2 <
ffff88013e7eba80 77231988 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff88013e7eba80 77232013 C Co:2:001:0 0 0
ffff8801a89373c0 77336027 S Co:2:001:0 s 23 01 0001 0007 0000 0
ffff8801a89373c0 77336065 C Co:2:001:0 0 0
ffff88013e7eb600 77336142 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88013e7eb600 77400007 C Co:2:001:0 0 0
ffff8801a8937840 77456019 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937840 77456073 C Ci:2:001:0 0 4 = 03031000
ffff88021f7e6000 77475988 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 77476000 S Ii:2:001:1 -115:128 2 <
ffff8802220a6900 77512014 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff8802220a6900 77512043 C Co:2:001:0 0 0
ffff8801a8937780 77512123 S Co:2:000:0 s 00 05 0018 0000 0000 0
ffff8801a8937780 77513991 C Co:2:000:0 -62 0
ffff88000df9db40 77716038 S Co:2:000:0 s 00 05 0018 0000 0000 0
ffff88000df9db40 77717986 C Co:2:000:0 -62 0
ffff88000df9db40 77920668 S Co:2:001:0 s 23 01 0001 0007 0000 0
ffff88000df9db40 77920711 C Co:2:001:0 0 0
ffff8802220a6240 77920771 S Co:2:001:0 s 23 03 0004 0007 0000 0
ffff88021f7e6000 77931008 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 77931027 S Ii:2:001:1 -115:128 2 <
ffff88021f7e6000 77978993 C Ii:2:001:1 0:128 2 = 8000
ffff88021f7e6000 77979003 S Ii:2:001:1 -115:128 2 <
ffff8802220a6240 77984050 C Co:2:001:0 0 0
ffff8801a8937780 78040053 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801a8937780 78040101 C Ci:2:001:0 0 4 = 03031000
ffff8802220a6900 78096019 S Co:2:001:0 s 23 01 0014 0007 0000 0
ffff8802220a6900 78096053 C Co:2:001:0 0 0
ffff8801a8937180 78096105 S Co:2:000:0 s 00 05 0019 0000 0000 0
ffff8801a8937180 78097968 C Co:2:000:0 -62 0
ffff8802220a6900 78300032 S Co:2:000:0 s 00 05 0019 0000 0000 0
ffff8802220a6900 78301951 C Co:2:000:0 -62 0
ffff88013e7ebcc0 78504634 S Co:2:001:0 s 23 01 0001 0007 0000 0
ffff88013e7ebcc0 78504671 C Co:2:001:0 0 0
ffff88000df9dcc0 78505411 S Co:2:001:0 s 23 01 0001 0007 0000 0
ffff88000df9dcc0 78505456 C Co:2:001:0 0 0
ffff8801637a2840 78505482 S Ci:2:001:0 s a3 00 0000 0007 0004 4 <
ffff8801637a2840 78505506 C Ci:2:001:0 0 4 = 01030000
ffff88021f7e6000 78505588 C Ii:2:001:1 -2:128 0

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Sat Apr 29, 2017 2:36 pm

in order to debug further, I purchased Pocket AVR programmer from sparkfun, https://www.sparkfun.com/products/9825 I am able to use that programmer with my chip and avrdude. (on osx, installed via homebrew).

I removed the ATtiny2313 from the socket on the USBTinyISP and hooked it up to the Pocket AVR Programmer (PAP)

got these fuse values. (still trying to learn what they mean. )
Code: Select all | TOGGLE FULL SIZE
avrdude: safemode: Fuses OK (E:FF, H:9D, L:E4)

do those look right?

I also tried reading the flash off of it, to compare it's md5 sum against possible versions from upstream
Code: Select all | TOGGLE FULL SIZE
avrdude -c usbtiny -p m8 -p t2313 -U flash:r:usbtinyisp.bak.hex:i

Code: Select all | TOGGLE FULL SIZE
MD5 (usbtinyisp.bak.hex)            = 1a78369fa91963f32be4b3087ebf2ef1

does that match anyone else? (should it? )

It didn't match any i found, but that was a long shot to say "it's good" could still be good.
Code: Select all | TOGGLE FULL SIZE
MD5 (usbtinyisp v1.0/spi/main.hex)  = 685affa01693f6391513adcc5c0eb4b2
MD5 (usbtinyisp v2.0/spi/main.hex)  = e2193820174973295ca87bbcb0d38e44
MD5 (usbtinyisp v1.04/spi/main.hex) = 66730fe6be32715c7abf690ea1aea5af


I'm debating trying to write the lastest 2.0 firmware back to the chip. but trying to figure out some other non destructive debugging I can do. I should order another chip.

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Wed May 03, 2017 11:50 pm

FWIW I showed that comparing md5 sum's like that doesn't work.

I've also ordered another chip with the firmware on it.

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Re: unable to enumerate USB device, persistent enumeration

by fessyfoo on Wed May 10, 2017 12:54 am

got a replacement chip and it works!

debugged the old chip, it has wrong fuses, and bad software.

the fuses on the replacement chip:
Code: Select all | TOGGLE FULL SIZE
avrdude: safemode: Fuses OK (E:FF, H:DF, L:EF)


http://eleccelerator.com/fusecalc/fusec ... LOCKBIT=FF

definitely different. set to use the external resonator in the kit.

the original fuses were definitely wrong, set to use the internal osc,

Code: Select all | TOGGLE FULL SIZE
avrdude: safemode: Fuses OK (E:FF, H:9D, L:E4)

http://eleccelerator.com/fusecalc/fusec ... LOCKBIT=FF

I tried first setting the fuses.
Code: Select all | TOGGLE FULL SIZE
avrdude -c usbtiny  -p t2313 -U lfuse:w:0xEF:m  -U hfuse:w:0xDF:m  -U efuse:w:0xFF:m

this didn't help.

so I pulled down the flash from the good chip, and wrote it to the "bad" chip.


Code: Select all | TOGGLE FULL SIZE
# hook up good chip
avrdude -c usbtiny  -p t2313 -U flash:r:usbtinyisp.good.hex:i
# hook up "bad" chip
avrdude -c usbtiny  -p t2313 -U flash:w:usbtinyisp.good.hex:i


after that the "bad" chip was fixed and works.

a couple other things to note:

When this thing is working on osx el capitan on a macbook with usb 3.0 port, it almost immediately lights the green light when plugged into usb. no target chip needs to be attached. no initial communication with avrdude required. it also shows up as usbtiny in the system information app on the usb bus. nothing shows in the system log. (no errors is good)

Another thing to note, the "good" chips fuses are set to require an external oscillator. It was not obvious to me, a n00b, that you can't communicate with a chip in this state from avrdude via usbtinyisp without supplying clock on the xtal pin. (I naively thought the programmer was supplying clock. but that's only clock for the isp communication and it's speed must be 1/4 of the clock of the chip. ) I learned you can supply clock in a lot of ways. I used an attiny85 (my first chip I was trying to program.) I set it's ckout fuse, and then used it's ckout pin to drive the xtal pin on my target chip, gave it power and ground along with the target chip and it all worked. yay.

I'm pretty bummed I ended up with a bad chip for a project that was my first programmer. I imagine a lot of people would be coming at this as their first programmer. I hope that accident doesn't happen often. I ended up having to buy the sparkfun pocket programmer as well, to get through it all.

the consolation prize was I learned a lot.




fixed.png
fixed.png (74.9 KiB) Viewed 1335 times

fessyfoo
 
Posts: 8
Joined: Sun Apr 23, 2017 8:33 pm

Please be positive and constructive with your questions and comments.