|
Hello,
if've the same problem with CyU3PUsbGetEP0Data and CyU3PUsbStall.
Is there any example without the issue?
I write on UART continously the string given in example "Data tracker: buffers sent: %d.\r\n".
Now if I call the function
status = CyU3PUsbGetEP0Data(4096, glEp0Buffer, NULL);
there is no more output on UART.
My code:
[...]
uint8_t glEp0Buffer[4096]; //length has to be multiple of 16 bytes
[...]
switch(vReq) {
case VR_WRITE:
CyU3PDebugPrint(2, "write\r\n");
status = CyU3PUsbGetEP0Data(4096, glEp0Buffer, NULL);
if(CY_U3P_SUCCESS == status ) {
CyU3PDebugPrint(2, "success\r\n");
}
else {
if(status == CY_U3P_ERROR_BAD_ARGUMENT)
CyU3PDebugPrint(2, "CY_U3P_ERROR_BAD_ARGUMENT%x\r\n", status );
else
CyU3PDebugPrint(2, "error%x\r\n", status );
CyU3PUsbStall (0, CyTrue, CyFalse);
}
break;
case VR_READ:
CyU3PDebugPrint(2, "read\r\n");
status = CyU3PUsbSendEP0Data(4096, glEp0Buffer);
if(CY_U3P_SUCCESS == status ) {
CyU3PDebugPrint(2, "success\r\n");
}
else {
CyU3PDebugPrint(2, "error%x\r\n", status );
}
break;
case CY_U3P_USB_TARGET_ENDPT:
if(wValue == CY_U3P_USBX_FS_EP_HALT) {
/* Clear stall on the endpoint. */
CyU3PUsbStall (wIndex, CyFalse, CyTrue);
}
break;
}
[...]
|