AVR-USB hangs when using usbSetInterrupt(0, 0)
Posted: Sat Nov 15, 2008 4:18 am
Hi,
I wrote a little fw which indicates whether the host should read data by setting it's interrupt1-in-flag. When I call the usbSetInterrupt-method by eg
it works fine. If I (at the same codeline) call it by
libUsb also returns from
but the control transfer directly following it
does endlessly return
and usb_interrupt_read doesn't block anymore.
AVR-source and accessing Java-source attached.
Regards,
Chris
/Edit:
To clarify two things ... When I use
while the device isn't opened the function getString in Main.java fails to get the requested information of AVR-USB.
AVR-USB hanging does not mean that the whole uC hangs ... It's just AVR-USB not responding to requests.
I wrote a little fw which indicates whether the host should read data by setting it's interrupt1-in-flag. When I call the usbSetInterrupt-method by eg
Code: Select all
usbSetInterrupt(&LED_PORT, 1);
Code: Select all
usbSetInterrupt(0, 0);
Code: Select all
usb_interrupt_read(handle, USB.REQ_TYPE_DIR_DEVICE_TO_HOST | 1, buffer, buffer.length, 24*60*60*1000);
Code: Select all
usb_control_msg(handle, USB.REQ_TYPE_DIR_DEVICE_TO_HOST | USB.REQ_TYPE_TYPE_VENDOR | USB.REQ_TYPE_RECIP_DEVICE, 1, 0, 0, buffer, buffer.length, 5000);
Code: Select all
error sending control message: Protocol error
AVR-source and accessing Java-source attached.
Regards,
Chris
/Edit:
To clarify two things ... When I use
Code: Select all
usbSetInterrupt(0, 0);
AVR-USB hanging does not mean that the whole uC hangs ... It's just AVR-USB not responding to requests.