[solved] Problems at some modulo 8 byte boundary
Posted: Mon Aug 22, 2011 10:39 pm
In short:
* My hardware: Arduino, runs at 16MHz, with USB Host Shield, and with VUSB
* My intention: create an USB proxy
* My problem: My response to GET DESCRIPTOR from VUSB to laptop fails.
If my laptop asks for either the device descriptor of configuration descriptor (haven't tested other descriptors), wireshark reports
URB status: Illegal byte sequence (-EILSEQ) (-84)
But is it not always the case. Also, the "URB length" and "Data length" that wireshark reports, have all been 0 modulo 8: I have seen 8, 16, 48, 80, 104 bytes.
I believe my debugging output it not taken up too much time. The USB 2.0 spec in 9.2.6.4 "Standard Device Requests" allows for 500ms to complete the configuration descriptor (if I read incorrectly it is 50ms). Wireshark timing example (for a 104 byte one):
Time delta from previous captured frame: 0.180987000 seconds
My USB cable is somewhat homebrew; abused an old standard cable (fullspeed max), soldered wires to pins for breadboarding. Could this be the problem? If there is too much interference (because of unshielded pins), the "illegal byte sequence" reported by wireshark makes sense.
The Arduino runs at 16MHz which is not that suitable for VUSB (according to the assembly and readmes). If VUSB runs out of sync, the "illegal byte sequence" reported by wireshark makes sense. Could this be the problem.
VUSB is connected to Arduino pins 2, 4 and 5. If I read correctly, it uses the interrupt with highest precendence; I do not expect errors because of servicing other interrupts.
FWIW #1: I use custom USB_CFG_DESCR_PROPS_* in usbconfig.h [(USB_PROP_IS_DYNAMIC | USB_PROP_IS_RAM)]
FWIW #2: I already replaced the code asking for the configuration descriptor via the USB Host Shield with a static configuration descriptor (but still via USB_PROP_DYNAMIC and _RAM). This does not solve the problem. It seems that the USB Host Shield is not failing me.
Can USB_CFG_HAVE_MEASURE_FRAME_LENGTH=1 and usage of usbMeasureFrameLength(void) be of any help?
My biggest problem is that I do not know what would be a good starting place for debugging and I am not sure what the foremost suspect is. Just some pointers would probably help a lot.
* My hardware: Arduino, runs at 16MHz, with USB Host Shield, and with VUSB
* My intention: create an USB proxy
* My problem: My response to GET DESCRIPTOR from VUSB to laptop fails.
If my laptop asks for either the device descriptor of configuration descriptor (haven't tested other descriptors), wireshark reports
URB status: Illegal byte sequence (-EILSEQ) (-84)
But is it not always the case. Also, the "URB length" and "Data length" that wireshark reports, have all been 0 modulo 8: I have seen 8, 16, 48, 80, 104 bytes.
I believe my debugging output it not taken up too much time. The USB 2.0 spec in 9.2.6.4 "Standard Device Requests" allows for 500ms to complete the configuration descriptor (if I read incorrectly it is 50ms). Wireshark timing example (for a 104 byte one):
Time delta from previous captured frame: 0.180987000 seconds
My USB cable is somewhat homebrew; abused an old standard cable (fullspeed max), soldered wires to pins for breadboarding. Could this be the problem? If there is too much interference (because of unshielded pins), the "illegal byte sequence" reported by wireshark makes sense.
The Arduino runs at 16MHz which is not that suitable for VUSB (according to the assembly and readmes). If VUSB runs out of sync, the "illegal byte sequence" reported by wireshark makes sense. Could this be the problem.
VUSB is connected to Arduino pins 2, 4 and 5. If I read correctly, it uses the interrupt with highest precendence; I do not expect errors because of servicing other interrupts.
FWIW #1: I use custom USB_CFG_DESCR_PROPS_* in usbconfig.h [(USB_PROP_IS_DYNAMIC | USB_PROP_IS_RAM)]
FWIW #2: I already replaced the code asking for the configuration descriptor via the USB Host Shield with a static configuration descriptor (but still via USB_PROP_DYNAMIC and _RAM). This does not solve the problem. It seems that the USB Host Shield is not failing me.
Can USB_CFG_HAVE_MEASURE_FRAME_LENGTH=1 and usage of usbMeasureFrameLength(void) be of any help?
My biggest problem is that I do not know what would be a good starting place for debugging and I am not sure what the foremost suspect is. Just some pointers would probably help a lot.