Stephen Williams wrote: >>something else you might try: in order to re-synchronize the >>communication you may insert a dummy read/write/read command and ignore >>the error code if an error occurs. The first read will fail in normal >>case (no previous write issued, the device is awaiting a new command) >>and succeed in the unusual case when the device communication is >>out-of-sync... >> >>please report your experiences and let us know whether this makes the >>code more robust, >> >>Holger >> >> > >Ahhh, now we're heading outside of my current abilities, sorry but i'm >an embedded systems Ada programmer by trade. I've never used C in >anger and I don't know my why around the kernel / drivers, i'm much >more at home when there isn't an OS ;-) If you could give me a bit >more of a hint I should be able to figure it out. > > Out of my mind the USB message would look somewhat like this: unsigned char msg [64]; /* dummy command readback to get back in sync if we are out-of-sync */ memset(msg, 0, sizeof(msg)); /* ignore error code here */ usb_bulk_write(fx2->dev, 1, msg, sizeof(msg), 200); if ((ret = usb_bulk_read(fx2->dev, 1, msg, sizeof(msg), 200)) > 0) /* just some verbosity for debugging... */ msg("fetched %d bogus bytes from read buffer...\n", ret); but please check twice to be sure. Don't know for sure if the USB API syntax is correct, please adopt in case it is not. Holger