hidkeys: device not accepting address ...

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
ecraven

hidkeys: device not accepting address ...

Post by ecraven » Thu Jan 11, 2007 10:48 am

i have built HIDKeys (without any buttons yet) and uploaded the .hex
if i plug in the device, i get

usb 5-2: new low speed USB device using uhci_hcd and address 2
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: device not accepting address 2, error -71
usb 5-2: new low speed USB device using uhci_hcd and address 3
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: device not accepting address 3, error -71
hub 5-0:1.0: port 2 not reset yet, waiting 50ms
usb 5-2: new low speed USB device using uhci_hcd and address 4
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: uhci_result_common: failed with status 440000
usb 5-2: device descriptor read/64, error -71

kernel 2.6.19-rc2, /sys/modules/usbcore/parameters/old_scheme_first is true
any ideas?

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Sun Jan 14, 2007 5:07 pm

This indicates a very fundamental problem. Only the pull-up resistor on D- is detected, no other communication succeeds.

I therefore suspect that you have a hardware problem. Have you checked wiring? And are you sure that you use zener diodes on D+ and D- or a 3.3V regulator for the supply?

Guest

Post by Guest » Mon Jan 15, 2007 10:42 am

ah, that's the problem.. the image on the HIDKeys page has the zener diodes, but the .pdf in the tarball does not! so I seem to have an outdated version, i'll correct that today, thanks a lot for the help!

ecraven

Post by ecraven » Tue Jan 16, 2007 10:38 am

hm.. i tried putting the diodes in, didn't help.. any chance the schematics are wrong?

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Jan 18, 2007 12:26 pm

No, the schematics should be OK.

Another idea: Have you set the fuse bits of the AVR correctly? Make sure that it is clocked with the external crystal (which MUST be 12 MHz), not the internal RC oscillator.

Guest

Post by Guest » Thu Jan 18, 2007 3:33 pm

ah, i thought the fuses are set from inside main.c, but i guess that's quite wrong.. sorry about all the dumb questions, i'll go and fix the fuses tonight :)

Guest

Post by Guest » Fri Jan 19, 2007 9:46 am

whoot, it works! thank you very much for the help, the circuit gets detected as a HID device, now i just have to figure out how to actually program it, but that's between me and avr-gcc :)

kiwi

USB stack seems to not work here

Post by kiwi » Sat Jan 20, 2007 1:48 am

Hello,

I'm starting with avr and usb.
I have set up an hardware identical to the usbtiny (without LCD) :
D- -> PD4 (I have added a 3V6 zener)
D+ -> PD2 (I have added a 3V6 zener)
pullup resistor on PD3
status led on PD5
IR on PD6

I have build a flash with nothing in it :
only connectdevice, usbinit, ...
no IR etc...

I have uploaded the hex file to the attiny2313, set the fuse as it's in the doc (using ponyprog)

My device is "detected" by the computer as "1.5 Mb/s"
but I have the same error message

...
usb 4-1: new low speed USB device using uhci_hcd and address 2
usb 4-1: uhci_result_common: failed with status 440000
usb 4-1: uhci_result_common: failed with status 440000
usb 4-1: device not accepting address 2, error -71
usb 4-1: new low speed USB device using uhci_hcd and address 3
...

Is there a simple way to check if I didn't make an hardware / software mistake ?

btw : my mother board is an abit IL90-mv

Thanks

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Jan 22, 2007 5:26 pm

If you get the "device not accepting address" error, there is no USB communication at all. The "new low speed USB device" message means only that the 1.5 k pull-up resistor was detected.

This may mean almost anything. Good candidates are
  • Fuse bits not set for external clock.
  • Voltage level mismatch on D+/D- (no zeners and no 3.3 V regulator).
  • I/O pins not configured as inputs without pull-up.
  • Interrupt pin not wired correctly.
  • Configuration in usbconfig.h does not match actual hardware.


If you compile the code with debug level 2, the driver prints debug information on the USART Tx pin.

ksz
Rank 1
Rank 1
Posts: 26
Joined: Tue Jan 09, 2007 9:10 pm
Location: Poland

Post by ksz » Mon Jan 22, 2007 8:25 pm

I've build some time ago circuit like usbtiny's ir+lcd..
That was working fine with usbtiny's firmware, but not with OBDEV's..
Just try with that firmware..

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Jan 22, 2007 8:33 pm

The version of AVRUSB which was available when usbtiny was written had a timing bug in the USB ID assignment. This bug has been fixed several versions ago.

ksz
Rank 1
Rank 1
Posts: 26
Joined: Tue Jan 09, 2007 9:10 pm
Location: Poland

Post by ksz » Mon Jan 22, 2007 8:52 pm

christian wrote:The version of AVRUSB which was available when usbtiny was written had a timing bug in the USB ID assignment. This bug has been fixed several versions ago.


BTW where (in which example project?) is always the freshest version of AVRUSB?

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Jan 22, 2007 8:56 pm

The most recent version is always in the PowerSwitch project. This is the most basic example.

kiwi

Post by kiwi » Wed Jan 24, 2007 12:37 am

Well,

the usbtiny firmware works fine except that I have a bug when I do a :

Code: Select all

 /etc/init.d/hotplug stop
 /etc/init.d/hotplug start


I think that something is wrong in the usbtiny firmware with the reset (probably because my usb is too picky with devices)

anyway, I'll recheck the whole configuration :
- fuse bits (should be ok because I set the fuses as it's explained in Powerswitch)
- wiring should be ok as it "works with usbtiny firmware"
- I have probably a misconfiguration in usbconfig.h

I'll write a report as soon as I can recheck the whole thing.

BTW, does anyone can tell me how I should wire the TX port in order to get the debug information in some kind of minicom ?

cheers

christian
Objective Development
Objective Development
Posts: 1442
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Jan 24, 2007 8:38 pm

Just because it works with usbtiny does not mean that the wiring is OK. The wiring must match your settings in usbconfig.h and these may differ from the usbtiny settings.

In order to see debug info, you must connect the Tx pin through an inverting level converter (such as the MAX232) to the Rx pin of the serial port of your computer. Then tell minicom to ignore all types of handshakes (if this option is available).

If you don't have a MAX232, you should at least generate levels of +/- 5 V, e.g. with transistors. There are many circuit diagrams for RS232 level converters available on the net.

Post Reply