- Please confirm if the DMA channel (MANUAL OUT) and the endpoint configuration (0x83) is done after getting the USB event CY_U3P_USB_EVENT_SETCONF. If not, please try creating the channel after this event is seen.
- Also, confirm if the host application sends the USB IN request on the endpoint (0x83) for reading the Leader and trailer data.
You can check for the CY_U3P_DMA_CB_CONS_EVENT in the DMA callback. The CY_U3P_DMA_CB_CONS_EVENT will be triggered only when the USB consumes the data (i.e. when the host sends the IN request to that endpoint)
1) Register for the event and the callback
dmaCfg.notification =CY_U3P_DMA_CB_CONS_EVENT ;
dmaCfg.cb = CyUvcAppDmaCallback;
2) Trace the CY_U3P_DMA_CB_CONS_EVENT events in the callback
CyU3PDmaCBInput_t *input )
if(type == CY_U3P_DMA_CB_CONS_EVENT)
3) And later get the variable printed in the for(;;) loop
Please note that if different Channels are used for streaming and sending the leader and trailer packets the host application should send requests to both the endpoints 1)streaming endpoint 2) leader/trailer endpoint accordingly. The host application should be capable to synchronize the requests for leader >> video data >>trailer
You can try sending the leader and trailer with the same DMA channel instead of using two DMA channels.
This can be done by modifying the GPIF state machine such that the empty DMA buffers are committed to add a leader and trailer for each frame. This will happen in the DMA round-robin fashion.
Please refer to the GPIF state machine in this thread USB3 Vision DMA on Leader packet on FX3 and let me know if it helps