|
Hi
dmaSlFifoConfig.size = size * 16;//CY_FX_ENDPOINT_BULK_BURST;
dmaSlFifoConfig.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaSlFifoConfig.prodSckId = (CyU3PDmaSocketId_t)(CY_FX_EP_PRODUCER_PPORT_SOCKET);
dmaSlFifoConfig.consSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_CONSUMER_USB_SOCKET);
dmaSlFifoConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaSlFifoConfig.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaSlFifoConfig.cb = CyFxSlFifoPtoUDmaCallback;
//dmaSlFifoConfig.cb = NULL;
dmaSlFifoConfig.prodHeader = 0;
dmaSlFifoConfig.prodFooter = 0;
dmaSlFifoConfig.consHeader = 0;
dmaSlFifoConfig.prodAvailCount = 0;
/* Create the channel */
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
CY_U3P_DMA_TYPE_MANUAL,
&dmaSlFifoConfig);
/* DMA Callback function to handle the Produce Events for P to U transfers */
void
CyFxSlFifoPtoUDmaCallback (
CyU3PDmaChannel *chHandle, /* Handle to the DMA channel. */
CyU3PDmaCbType_t type, /* Callback type. */
CyU3PDmaCBInput_t *input /* Callback status. */
)
{
CyU3PReturnStatus_t apiRetStatus;
/* This is a produce event notification to the CPU */
/* This notification is received upon reception of every buffer */
/* Buffer contents could be modified if necessary */
/* Commit the buffer for transfer */
/* Buffer status to be handled internally by DMA */
CyU3PDebugPrint (4, "\nCyU3PDmaChannelCommitBuffer p to U input->buffer_p.count = %d \n",input->buffer_p.count);
apiRetStatus = CyU3PDmaChannelCommitBuffer (chHandle, input->buffer_p.count,0);
CyU3PDebugPrint (4, "\nCyU3PDmaChannelCommitBuffer p to U \n");
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "P to U DMA MANUAL Channel Commit Buffer Failed, Error Code = %d\n",apiRetStatus);
}
}
I create a P to U DMA channel as above ,Then FPGA write data to usb by GPIF ,if the data size is less than 0x320 it works well .but when data size is more i can't receive any data. CyFxSlFifoPtoUDmaCallback even does not come in.
|