Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hang in WritePipe()



I'm betting on a device that NAKs forever. Your software can detect this condition by setting the last two parameters to IOUSBInterfaceClass::WritePipe, ( "noDataTimeout" and "completionTimeout" ) appropriately. Recovery in this case might consist of issuing some type of protocol reset to the device, or if that fails, actually using a ResetDevice (a very heavy hammer).

"noDataTimeout" - Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned.

"completionTimeout" - Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned.

Regards,

David Ferguson
USB Software Team
Apple



On Mar 2, 2007, at 2:19 AM, Steve Baxter wrote:

Hi,

We very intermittently get a hang in our software when writing to a particular device. It will work fine for days talking to the device many times per second, but then suddenly it will fail with this callstack:

268 Thread_1703
268 _pthread_body
268 MPosixThreadImp::ThreadEntry(void*)
268 MThread::RunThread()
268 XThread::RunThread()
268 XDeviceValuePoller::RunThreadSelf()
268 XLudlXYStage::PollDeviceValue(XDevice::XDeviceID)
268 XLudlController::SendHighLevelCommand(XString const&, XSerialPort const&, unsigned long)
268 XSerialPort::WriteData(void const*, unsigned long) const
268 MUSBSerialPort::WriteDataSelf(void const*, unsigned long) const
268 MUSBDevice::WritePipe(long, void const*, unsigned long) const
268 IOUSBInterfaceClass::WritePipe (unsigned char, void*, unsigned long, unsigned long, unsigned long)
268 io_connect_method_scalarI_structureI
268 mach_msg
268 mach_msg_trap
268 mach_msg_trap


Unfortunately the customer and the troublesome device are many thousands of miles away. Does anyone have any clues as to what might cause a hang like this in WritePipe()? This is probably a problem at the firmware end, but we would like to give the manufacturers some clues if we can!

Cheers,

Steve

Steve Baxter
Software Development Manager
Improvision
+44-2476-692229

_______________________________________________ Do not post admin requests to the list. They will be ignored. Usb mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden
References: 
 >Hang in WritePipe() (From: Steve Baxter <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.