VUSB + Ardunio Problem
Posted: Sat Aug 29, 2015 2:18 am
Here's the useful part of my code:
I'm able to send data back and forth fine for a few minutes, but after the device sits idle, it seems to become unresponsive to the OS(linux) and requires me to reset the Ardunio or unplug the USB cable. The device never shows a USB disconnect in dmesg when it's this unresponsive state and still shows up in lsusb. Also, when I lsusb -v the usb device in this bad state, i get an error when trying to read the vendor/product strings. These strings show correctly when it's responding.
Code: Select all
#include "usbdrv.h"
void setup() {
TIMSK0 &= !(1<TOIE0);
cli();
usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
usbDeviceConnect();
usbInit();
sei();
}
void loop() {
usbPoll();
}
}
I'm able to send data back and forth fine for a few minutes, but after the device sits idle, it seems to become unresponsive to the OS(linux) and requires me to reset the Ardunio or unplug the USB cable. The device never shows a USB disconnect in dmesg when it's this unresponsive state and still shows up in lsusb. Also, when I lsusb -v the usb device in this bad state, i get an error when trying to read the vendor/product strings. These strings show correctly when it's responding.