USB0 writeEP timing

Discussion created by adb on May 21, 2018
Latest reply on Jun 11, 2018 by adb



I'm trying to download 16MB of data from a flash memory in packets of 512 bytes using the LPC4353. My code is based on HID generic. I'm able to reliably download most of my data, but occasionally I get the odd glitch.


At a low level, I use writeEP to write my packet of data to USB0. I've found that I need a delay between 0.5 and 1 ms between packets. I also wait for a flag which I set in the HID_Ep_Hdlr interrupt callback whenever a USB_EVT_IN event occurs. bInterval has been set to 1ms. I understand that the microcontroller can only send the next packet of data to the PC at the PC's request?


How can I send data as fast as possible without any data loss?


Thanks in advance for any comments,