1 Reply Latest reply on Aug 29, 2017 10:08 AM by milkfish1227_2635671

    FX3 Control End Point read/write failure

    milkfish1227_2635671

      Hi,

      I am having trouble to using CCyControlEndPoint read/write for C++ console application on host. The code actually from Cypress library document. The FX3 firmware is the UsbSpiDmaMode sample code.

       

      My issue is the ept->Write/Read function always return false. I also tried on Control Center C# code, it returns true.

       

      Anything I might have done wrong?

       

         CCyControlEndPoint *ept = USBDevice->ControlEndPt;

         bool bXferCompleted = false;

       

         //  Just for typing efficiency

         ept->Target = TGT_DEVICE;

         ept->ReqType = REQ_VENDOR;

         ept->ReqCode = 0x07;

         ept->Value = 1;

         ept->Index = 0;

       

         unsigned char  buf[512];

         ZeroMemory(buf, 512);

         LONG bytesToSend = 128;

       

         bXferCompleted = ept->Write(buf, bytesToSend);

       

      Thanks,

      Dick