LPC2148/USB/HID Missing packets??

Hello,

I am using a custom LPC2148 board running the wonderful LPCUSB stack. While the examples compile fine and everything seems to be humming along, it does not appear that I am receiving all the packets I’d expect. To debug, I am using the following handler found at the bottom of this post. The device is set up as an interrupt transfer device (copied from the HID example) at a rate of 10 ms. I am using SniffUSB to capture incoming data. Is the handler called more than just when a read is necessary? Why do I not see a sequential series of numbers in my log?

Any help would be appreciated: pulling my hair out!

Bob

static void HandleFrame(U16 wFrame)

{

int idx;

abReport[0] = counter;

counter++;

for (idx=1;idx<REPORT_SIZE;idx++)

{

abReport[idx] = 0;

}

USBHwEPWrite(INTR_IN_EP, abReport, REPORT_SIZE);

}

While continuing to experiment with this problem, I discovered that the missing packets seem to be a function of the bInterval value in my endpoint descriptor. For example, if I set the polling interval to be 8, I’ll see 1 out of 8 packets, or using the handler shown above, I’ll see a sequence such as 16, 24, 32, 40, 48, and so on. While I have thrown together a workaround for the time being, I would really like to understand why this happens.

My USB subcircuit is roughly equal to the Olimex LPC2148 evaluation board.

Thank you,

Bob

Hi, I’m having a similar problem & was wondering if anyone can help.

I’m trying to send a 16-byte packet every 1ms. I’ve created a HID device using LPCUSB with an interrupt endpoint whose interval is set to 1ms. I’m using a handler registered with “USBHwRegisterFrameHandler” to schedule sends. However, every other packet is dropped.

I tried reverting to a simple counter experiment like hokieengr tried, but even with a polling interval of 1ms, I still only see every other packet. Any ideas?

Also, what’s the proper way to deal with interrupt traffic when you want to send reports larger than 64Bytes? Are you supposed to start the send with the Frame interrupt and continue it in the Endpoint interrupt? That was unclear.

Thanks!