Gentoo Archives: gentoo-user

From: Stefan Mark <mark@××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] USB device (ATtiny86 w. mcronucleus bootloader) not recognized ?
Date: Mon, 07 Aug 2017 09:29:42
Message-Id: 20170807112912.1eff6cdd@vdhh-linux
In Reply to: Re: [gentoo-user] USB device (ATtiny86 w. mcronucleus bootloader) not recognized ? by R0b0t1
1 On Sun, 6 Aug 2017 19:04:09 -0500
2 R0b0t1 <r030t1@×××××.com> wrote:
3
4 > On Sun, Aug 6, 2017 at 11:50 AM, <tuxic@××××××.de> wrote:
5 > > When I plug in such a little board into my PC, demesg
6 > > reports:
7 > > [ 1429.834140] usb 7-4: new low-speed USB device number 15 using
8 > > ohci-pci [ 1429.965142] usb 7-4: device descriptor read/64, error
9 > > -62 [ 1430.203151] usb 7-4: device descriptor read/64, error -62
10 > > [ 1430.438161] usb 7-4: new low-speed USB device number 16 using
11 > > ohci-pci [ 1430.569151] usb 7-4: device descriptor read/64, error
12 > > -62 [ 1430.803174] usb 7-4: device descriptor read/64, error -62
13 > > [ 1431.038184] usb 7-4: new low-speed USB device number 17 using
14 > > ohci-pci [ 1431.456157] usb 7-4: device not accepting address 17,
15 > > error -62 [ 1431.582204] usb 7-4: new low-speed USB device number
16 > > 18 using ohci-pci [ 1432.000209] usb 7-4: device not accepting
17 > > address 18, error -62 [ 1432.000244] usb usb7-port4: unable to
18 > > enumerate USB device
19 >
20 > >
21 > > My first thought was: The micronucleus bootloaed is missing or
22 > > is defective...
23 > >
24 > > But plugging in the board into my Android tablet (the tablet runs
25 > > Lollipop and is nothing special at all beside being rooted) via
26 > > an OTG cable and using lsusb after that, it shows
27 > > Bus 001 Device 003 ID 16d0:0753 MCS Digistump DigiSpark
28 > >
29 >
30 > What the dmesg output is saying is that your USB hardware has reported
31 > a communication error to the driver. It is my guess that the ATtiny85
32 > is not meeting the timing requirements for USB.
33 >
34 > Looking at the board there does not seem to be a crystal oscillator
35 > which most people would consider necessary for doing USB
36 > communication. This is an oversight on DigiStump's part and it is very
37 > likely you will not be able to fix the communication issues. You
38 > should contact them and tell them that your computer will not
39 > recognize their device and that you suspect it is because the clock is
40 > too inaccurate.
41 >
42 > >
43 > > What can I do to make this Digispark being correctly recognized?
44 > >
45 > > Thank you VERY much for any help in advance!
46 > >
47 >
48 > Three things:
49 >
50 > 1) Return the one you bought and get a new one. The ATtiny85's
51 > internal oscillator might be at the end of the bell curve but within
52 > manufacturer tolerance, which isn't enough to produce a USB signal
53 > close enough to the specified frequency. Expect the seller to pay for
54 > return shipping.
55 >
56 > 2) You can calibrate the oscillator using instructions in this
57 > application note:
58 > http://www.atmel.com/Images/Atmel-2555-Internal-RC-Oscillator-Calibration-for-tinyAVR-and-megaAVR-Devices_ApplicationNote_AVR053.pdf.
59 > This process still might not get you close enough.
60 >
61 > 3) Add a crystal oscillator to the ATtiny85 and change its fuses to
62 > use the oscillator. You will need to recompile the firmware if the
63 > crystal is a different frequency from the internal oscillator.
64 >
65 > It might work on your phone and not your desktop because of
66 > differences in the USB hardware (your phone's serial decoder in the
67 > USB hardware performs clock recovery but your PC does not) or because
68 > there are multiple things on a USB hub in your PC and the ATtiny85 is
69 > less accurate than those already present devices. Admittedly I'm
70 > surprised it gets most of the way to registering as a device and then
71 > fails, but I don't think the problem is with the drivers or your
72 > kernel.
73 USB uses a variant of non-return-to-zero for clock synchronisation,
74 that should™ take care of timing issues.
75 Actually, using microcontrollers without crystal for soft-usb is fairly
76 common (i have a bunch myself). As far as i understand (but im no
77 expert), trouble usually arises more from the improvised level shifters
78 than timing issues.
79 Anyway, i neither think there is a driver problem, i had a fair bit of
80 the messages myself, usually fixed by fixing the level shifter.

Replies