Device descriptor read/64, error -71; no ISR?
Posted: Thu Dec 03, 2009 8:35 pm
Hi all,
I am trying to port avrusbboot from http://www.fischl.de to the latest (2009-08-22) version of v-usb
I am using an atmega 328p at 20MHz, crystal oscillator (supported by the latest v-usb, but not the one in arvusbboot)
I am using the following circuit:
Vcc is 5V (3.3V is not enough for 20MHz)
1.5k pullup from D- to RESET, 1.5k pullup from there to Vcc (causes a reconnect when the programmer resets the chip or I push the reset button)
100ohm resistors on Dx to PortDx
3.3V Zeners (no 3.6V ones in the shop )
1M pulldown on D+ (for when the cable is unplugged)
D- goes to PortD0, D+ to PortD2/INT0
PORTD1,3 are debug LEDs, I turn on PORTD1 on entering the bootloader (before any usb setup), and the other one when leaving (test for the bootloader condition and boot sector use)
After some modifications, the code compiles
So far, the LEDs indicate I am entering the bootloader properly, but the device is not responding on usb:
dmesg says:
[284388.070538] usb 4-1: new low speed USB device using uhci_hcd and address 64
[284388.190169] usb 4-1: device descriptor read/64, error -71
[284388.413460] usb 4-1: device descriptor read/64, error -71
[284388.628777] usb 4-1: new low speed USB device using uhci_hcd and address 65
[284388.748406] usb 4-1: device descriptor read/64, error -71
[284388.971697] usb 4-1: device descriptor read/64, error -71
[284389.187012] usb 4-1: new low speed USB device using uhci_hcd and address 66
[284389.593728] usb 4-1: device not accepting address 66, error -71
[284389.705381] usb 4-1: new low speed USB device using uhci_hcd and address 67
[284390.112088] usb 4-1: device not accepting address 67, error -71
I saw this post:
viewtopic.php?f=8&t=2663#p11936
and therefore changed line 60 in usbdrvasm.S to:
# ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */
# define USB_INTR_VECTOR INT0_vect
# endif
But to no avail
I suspected the ISR was not firing (based on aforementioned post and others), so I added these lines to usbavrdrvasm20.inc:
line 55>
;jo
ldi r16, 0xFF;
out PORTD, r16;
;/jo
I know this will clobber whatever might be in r16, screw up timing, and also activate D+/D- pullups, but at this point I don't care if it crashes completely, as long as it tells me the ISR is called...
This code might be very wrong, I'm new to avr assembly
The result was:
* Code size grew by 4 bytes (sounds right to me)
* The second LED on PortD does not turn on, even though the PC clearly toggles D- (I placed LEDs on Dx, and they shimmer on reconnect)
I tried without the Zeners, but no change (D+ is at 2.2V when only the pullup is driving it with the 3.3V Zeners, so maybe the level was too low to register as HIGH)
I tried connecting PortD2 to GND then Vcc manually after starting the circuit (should trigger a interrupt, no?), but the LED still does not turn on
This seems to indicate that the ISR is not called, any ideas as to why/where to look?
Thanks in advance,
Jonathan
I am trying to port avrusbboot from http://www.fischl.de to the latest (2009-08-22) version of v-usb
I am using an atmega 328p at 20MHz, crystal oscillator (supported by the latest v-usb, but not the one in arvusbboot)
I am using the following circuit:
Vcc is 5V (3.3V is not enough for 20MHz)
1.5k pullup from D- to RESET, 1.5k pullup from there to Vcc (causes a reconnect when the programmer resets the chip or I push the reset button)
100ohm resistors on Dx to PortDx
3.3V Zeners (no 3.6V ones in the shop )
1M pulldown on D+ (for when the cable is unplugged)
D- goes to PortD0, D+ to PortD2/INT0
PORTD1,3 are debug LEDs, I turn on PORTD1 on entering the bootloader (before any usb setup), and the other one when leaving (test for the bootloader condition and boot sector use)
After some modifications, the code compiles
So far, the LEDs indicate I am entering the bootloader properly, but the device is not responding on usb:
dmesg says:
[284388.070538] usb 4-1: new low speed USB device using uhci_hcd and address 64
[284388.190169] usb 4-1: device descriptor read/64, error -71
[284388.413460] usb 4-1: device descriptor read/64, error -71
[284388.628777] usb 4-1: new low speed USB device using uhci_hcd and address 65
[284388.748406] usb 4-1: device descriptor read/64, error -71
[284388.971697] usb 4-1: device descriptor read/64, error -71
[284389.187012] usb 4-1: new low speed USB device using uhci_hcd and address 66
[284389.593728] usb 4-1: device not accepting address 66, error -71
[284389.705381] usb 4-1: new low speed USB device using uhci_hcd and address 67
[284390.112088] usb 4-1: device not accepting address 67, error -71
I saw this post:
viewtopic.php?f=8&t=2663#p11936
and therefore changed line 60 in usbdrvasm.S to:
# ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */
# define USB_INTR_VECTOR INT0_vect
# endif
But to no avail
I suspected the ISR was not firing (based on aforementioned post and others), so I added these lines to usbavrdrvasm20.inc:
line 55>
;jo
ldi r16, 0xFF;
out PORTD, r16;
;/jo
I know this will clobber whatever might be in r16, screw up timing, and also activate D+/D- pullups, but at this point I don't care if it crashes completely, as long as it tells me the ISR is called...
This code might be very wrong, I'm new to avr assembly
The result was:
* Code size grew by 4 bytes (sounds right to me)
* The second LED on PortD does not turn on, even though the PC clearly toggles D- (I placed LEDs on Dx, and they shimmer on reconnect)
I tried without the Zeners, but no change (D+ is at 2.2V when only the pullup is driving it with the 3.3V Zeners, so maybe the level was too low to register as HIGH)
I tried connecting PortD2 to GND then Vcc manually after starting the circuit (should trigger a interrupt, no?), but the LED still does not turn on
This seems to indicate that the ISR is not called, any ideas as to why/where to look?
Thanks in advance,
Jonathan