Content originally posted in LPCWare by kctang on Thu Jan 08 19:58:31 MST 2015
Hello,
I am using the NGX 4330 board to interface with a spectrometer device, USB0 port is configured in USB host mode
for high speed operation. The goal is reading a set of bulk IN data 7680 bytes in size. The program is based on
the lpcusblib software codes.
I use the Pipe_IsINReceived(portnum) function to initiate the read operation and
Pipe_Read_Stream_LE(portnum, &uv0_buf, sizeof(uv0_buf), NULL);
to read the USB data.
However, the Pipe_Read_Stream_LE() will not stop and when I halt the software program and
examine the uv0_buf[] data buffer, only 2560 bytes of data were received.
Can anyone help to solve the problem? Thanks in advance.
The program codes for the read operation are shown as below:
portnum = Spectrometer_Interface.Config.PortNumber;
Pipe_SelectPipe(portnum,Spectrometer_Interface.Config.X2DataINPipeNumber);
Pipe_Unfreeze();
ret_code = HcdGetPipeStatus(PipeInfo[portnum][pipeselected[portnum]].PipeHandle);
if (Pipe_IsINReceived(portnum))
{
Pipe_Read_Stream_LE(portnum, &uv0_buf, sizeof(uv0_buf), NULL);
Pipe_ClearIN(portnum);
}
Pipe_Freeze();