Slave FIFO(stream IN) EndPt->LastError = ERROR_IO_PENDING(997)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
XiXI_4139851
Level 1
Level 1

I implemented stream_in with CyAPI.lib. After calling WaitForXfer(), BulkInEndPtEndPt->LastError is equal to ERROR_IO_PENDING(997). I don't quite understand why this is.

TEST_METHOD(Test_StreamIn)
  {
   CCyUSBDevice  *USBDevice = new CCyUSBDevice(NULL);
   OVERLAPPED  inOvLap;
   inOvLap.hEvent = CreateEvent(NULL, false, false, L"CYUSB_IN");
   unsigned char inBuf[128];
   ZeroMemory(inBuf, 128);
   unsigned char buffer[128];
   LONG  length = 128;

   UCHAR  *inContext = USBDevice->BulkInEndPt->BeginDataXfer(inBuf, length, &inOvLap);
   USBDevice->BulkInEndPt->WaitForXfer(&inOvLap, 100);
   USBDevice->BulkInEndPt->FinishDataXfer(inBuf, length, &inOvLap, inContext);
   CloseHandle(inOvLap.hEvent);
  }

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

Error Code 997 occurs if there is no data to be read from the IN endpoint of the device. Please let us know the device being used and the mode of operation (AUTO or MANUAL).

Reasons for Error Code 997:

1. The expected bytes of data have not been transferred within the timeout period.

2. The endpoint sends NAK/ STALL.

Best regards,
Srinath S

View solution in original post

0 Likes
3 Replies