Hi guys, I'm currently trying to make a PIC18F4550 act as a protocol translator for a piece of data acquisition hardware. The DAQ box speaks the Microchip SPP protocol, my PC wants USB. The problem is, I can open the device once, send and receive data and commands and so on, but once my application calls usb_close() against the device and exits, that's it. The PIC stops responding to any USB requests until the USB plug is pulled and reinserted, or the PIC is reset (MCLR short to Vss). The PC comms software is written in C and uses libusb-0.1.12-13 (Ubuntu packaged version). OS is Ubuntu Linux 9.04. I've plugged a protocol analyser (Totalphase Beagle 480 USB) in between the PIC and the PC and this is what I'm seeing: PIC enumerates itself to the PC: Set Address Get Device Descriptor 2x Get Configuration Descriptor (the first one seems to be just to get the length of the CDesc, the 2nd is the actual CDesc) 3x Get String Descriptor (the PC reading the vendor/product strings and language ID) Set Configuration 1 First comms attempt Set Configuration 1 OUT: 09 11 (acked) OUT: 0B 80 64 (acked) IN: FE (acked) OUT: 09 00 (acked) [app exits here] Second attempt Set Configuration 1 OUT: 09 11 (acked) OUT: 0B 80 64 (acked) IN: [...] -- multiple IN requests from the PC, all of which time out If I break into the code with the ICD, it appears that the OUT endpoint is locked up -- this line (in user.c:ProcessIO) is continuously skipped over: // Check if the endpoint has received any data from the host. if(!USBHandleBusy(USBGenericOutHandle)) and as a result my processing code is never reached (confirmed with a few BPXes). Libusb reports that all the bulk_write requests were sent correctly (which I've confirmed with the analyser; the PIC ACKs all the DATA packets), and returns a timeout error for all the bulk_read requests (again confirmed, the PIC is NAKing all the IN packets). Has anyone else seen this kind of behaviour out of the Microchip USB stack (or LibUSB for that matter). Thanks. -- Phil. piclist@philpem.me.uk http://www.philpem.me.uk/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist