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;
LONG bytesToSend = 128;
bXferCompleted = ept->Write(buf, bytesToSend);
Never mind, I got it.
I have debug port USB-to-Serial cable connected as well. So there are more than 1 Cypress USB devices. Thx