cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

XiXI_4139851
New Contributor II

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
Reply
1 Solution
SrinathS_16
Moderator
Moderator

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
Reply
3 Replies
SrinathS_16
Moderator
Moderator

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
Reply
XiXI_4139851
New Contributor II

HI

I get the example code from AN65974 - Designing with the EZ-USB® FX3™ Slave FIFO Interface.Program the FX3 device with the firmware image file, SF_streamIN.img.Program the Xilinx  FPGA with the file, slavefifo2b_fpga_top.bit. Set the switch SW8 011. Cypress Streamer Utility works fine,but my test (Test_StreamIn)has been given an error.

0 Likes
Reply
SrinathS_16
Moderator
Moderator

Hello,

- Can you please increase the TimeOut parameter on the WaitForXfer() API and check if the error still persists?

Best regards,

Srinath S

0 Likes
Reply