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: Write to interrupt out pipe doesn't show immediately on device



Sounds like firmware issues in your device. Actually it sounds like a data-toggle problem with your device. It doesn't seem to recognize that the interrupt endpoint has data, unless you tickle another endpoint, or change the configuration. You might try using the device request CLEAR_FEATURE for ENDPOINT_HALT to see if that is enough to get it to recognize your endpoint.

I would expect that call to reset the data toggle on your endpoint (which is what happens usually when a SetConfiguration call is made).

I know what tool I would use to look at this problem...

David Ferguson
USB Software Team
Apple Computer

At 4:35 PM -0500 2/12/06, Daniel Jalkut wrote:
Just to confirm that this was probably a stupid newbie question to begin with...

I have done more research and since discovered that if I read bytes off the *input* interrupt queue then my output updates are carried out as expected. I suppose I probably just don't know enough about the USB contract to know why I need to do this, but ultimately I want to pay attention to the input interrupt too, so I'm OK with this workaround.

Daniel

On Feb 12, 2006, at 2:35 PM, Daniel Jalkut wrote:


I've modified the USBSimple example to open interrupt pipes instead of bulk transfer pipes. In doing this, I've managed to figure out a reasonable 7-byte output pipe format that causes the desired LED changes on my device.


However, the LEDs don't update immediately. In my testing, I noticed that I would see the updated LEDs only on the *second* run of the program. After a little debugging, I discovered the "truism":

-> After a WritePipe or WritePipeAsync (and runloop run to completion), the data written to the device doesn't seem to get there until the *next* time I call SetConfiguration on the device.

I'm pretty sure it must be a side-effect of the SetConfiguration call that is causing the data to "flush" or whatever. But does anybody have any tips for how I might proceed? I thought I would try to remote-debug the system and step into the SetConfiguration call, to see which call in the kernel corresponds with the flush. But that turned out to be more difficult than I was thinking. Before I hunker down again to get that debugging environment working as expected, I thought I might get lucky and gather some good leads here.

Is it typical that I should have to do something else after the WritePipe() call to make sure that the data gets pushed out? I would think that whatever "starting over" effect that calling SetConfiguration has would be roughly equivalent to the behavior of closing down the interface and device when the application quits. But even then the data doesn't seem to arrive until the next launch.

I suppose this is probably one of those famous "check the bus analyzer" type questions, but unfortunately I don't have access to one, and probably won't given the budget of this project.

Thanks for any leads you can provide!

Daniel

_______________________________________________
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

_______________________________________________ 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

_______________________________________________ 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: 
 >Write to interrupt out pipe doesn't show immediately on device (From: Daniel Jalkut <email@hidden>)
 >Re: Write to interrupt out pipe doesn't show immediately on device (From: Daniel Jalkut <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.