Re: [Fx2lib-devel] Arming bulk end points early
Status: Beta
Brought to you by:
mulicheng
From: Dennis M. <de...@ub...> - 2009-03-12 22:45:38
|
Eric Winsor wrote: > Dennis Muhlestein wrote: > >> If you find something, let us know! >> >> > I earned my cheese! > > Here is how to arm packets shorter than the host is asking for. First, > read all about IN-BULK-NAK in the EZ-USB technical reference manual. > There is a USB interrupt vector and registers that can be triggered on > and watched to catch that the host has asked for an IN packet and the > SIE is NAK'ing it. In code built from the Cypress firmware frameworks > model here is code for periph.c to commit a short packet. That's great Eric. So in summary, you can tell when the host wants data by enabling the IBN interrupt. I noticed a very important thing about their framework example. You can't just clear the interrupt. You have to disable it until you've handled the nak. Otherwise your poll function or main loop will not be able to do what it needs to do to commit the packet because the interrupt will continuously fire. The fx2lib usbjt.h macros haven't defined a macro for IBN yet. If I get around to adding that, I'll make sure to keep this example in mind. -Dennis |