Content originally posted in LPCWare by mathseng on Sun Oct 27 01:59:49 MST 2013
Hi Tsuneo,
With the code I have, I am unable to replicate the values you report, for the LPC1347 (testing with USB_MEM_BASE in either RamUsb2 or RamPeriph2).
I am hampered by only being exposed to USB and LPC since Aug'13, and I am relying upon the LPC docs and the LPC examples (ROM_USB_hid in NXP_LPC1347_2012_02_22.zip).
I get good results for HID USB ROM-based operations for multi-packet report sizes when using the default RamLoc8 segment for USB_MEM_BASE, but am missing some step for the other RAM segments (pBuffer parameter to HID_SetReport points to USB_MEM_BASE + 0x01ac, which does not appear correct for RamUsb2 and RamPeriph2, where the 64 byte buffer data is observed to be at USB_MEM_BASE + 0x0200)
Note: As per one of your posts, I set the HID_SetReport buffer of size HID_OUTPUT_REPORT_BYTES when the length passed is 0, and this works for me when USB_MEM_BASE is in RamLoc8.
Summary
a) EP0Data.Count appears to be at a higher level than HID_SetReport provides access to.
b) SetupPacket.wLength report size to HID_SetReport appears to be at a higher level than HID_SetReport provides access to.
However, I observed that:
+ the data in the USB_MEM_BASE segment 64 byte buffer at the call to HID_SetReport is the LAST packet of the USB transmission.
+ when a large buffer is provided (set *pBuffer = largeBuffer (on call when length==0) AND USB_MEM_BASE is in RamLoc8, the correct number of bytes is transferred, but nothing appears in largeBuffer when USB_MEM_BASE is in other RAM segments.
c) I made the presumption that HID_Ep_Hdlr is the interrupt OUT endpoint, consistent with GTA's report. With my code, I am successfully receiving packets of size < packetSize, size = packetSize * n (n = 1..n), and size = packetSize*n + x (where x = 1..packetSIze-1)
If you have published code which I can examine, I would appreciate the link to the webpage, so that I can create better software in my projects.
Bill