I am working on a Windows console application to write/read EP0. FX3 firmware doesn't do anything other than loopback the data get from EP0.
The Windows console application EP0 Read() takes about 5-6 seconds to complete. See code below -
bXferCompleted = ctrlEpt->Write((PUCHAR)puc_buf_out, (LONG &)ul_len);
bXferCompleted = ctrlEpt->Read((PUCHAR)puc_buf_in, (LONG &)ul_len);
Is there any reason why the EP0 Read takes so long to complete?
Buffer size in PC 256 uint8. I am sending 4 byte data in a EP0 control transfer.
In FX3, buffer was 4096. I changed to 256, doesn't seems make any difference. FX3 just loopback 4 byte data received from EP0.
//uint8_t glEp0Buffer __attribute__ ((aligned (32)));
uint8_t glEp0Buffer __attribute__ ((aligned (32)));
Hi Dick Lin,
From the other post, I see that you are actually doing SPI Transfer inside the setup callback. In order to narrow down the issue, please remove the SPI Transfer part of the code and see how much time it takes.
- Madhu Sudhan
I already comment out the SPI transition. The only thing the switch case doing is get EP0 data and send EP0 data. See below.
I have another post titled "
" has the source code for both host and FX3 firmware.
status = CyU3PUsbGetEP0Data (wLength, glEp0Buffer, NULL);
// if (status == CY_U3P_SUCCESS)
// status = CyFxSpiTransfer (wIndex, wLength, glEp0Buffer, CyFalse);
// for testing
status = CyU3PUsbSendEP0Data (wLength, glEp0Buffer);