Control EndPoint Error 997

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

cross mob
Anonymous
Not applicable

Apologies if this has been answered elsewhere but I have been unable to find anything.  I am new to the CyAPI and am trying to write a C++ application to communicate with a CY7C68013A.  However, whenever I attempt a read/write to the control endpoint, I see an error 997.  The functional part of my code is here:

   
    

CCyControlEndPoint *ept = USBDevice->ControlEndPt;

    

ept->Target = TGT_DEVICE;
ept->ReqType = REQ_VENDOR;
ept->Direction = DIR_TO_DEVICE;
ept->ReqCode = 0xA0;
ept->Index = 0x0000;
unsigned char buf[64];
ZeroMemory(buf, 64);
    
ept->Value = 0xE600;
LONG buflen = 1;
buf[0] = 1;
ept->XferData(buf, buflen);

    

ept->Direction = DIR_FROM_DEVICE;
ept->Value = 0xE60A;
buflen = 1;

    

ept->XferData(buf, buflen);

    

cout <<  "Data: " << hex << (int)buf[0] << dec <<  "\nError code: " << ept->LastError << '\n';

   
   

According to the documentation I've seen, this register should output a value of "1"; however, I get "5e".  In fact, for any register I try to access, I get "5e 6f" repeating.  Is there something I am missing about setting up the control endpoint or how I'm using it?

   

Thanks,

   

Scott

0 Likes
3 Replies