- Please mention the error code that you see while the mentioned API fails.
- In the firmware file that you have shared, I do not find the usage of mentioned API. Kindly, recheck.
- Are you facing issues in setting up the S-Port socket or in using the API?
PFA, In "CyFxBulkLpDmaCallback" function, I have implemented"CyU3PSdioExtendedReadWrite" API with producer socket ID.
In the first call, it is not throwing any error, but writing is not happening. In second call it is throwing an error "CY_U3P_ERROR_DEVICE_BUSY" (0x73). (Using USB Control Center to read/write Endpoint)
cyfx3s_sdiouart.c.zip 11.8 K
- In the CyU3PSdioExtendedReadWrite() API, the sckId parameter should be set to one of the SIB sockets and it should be a producer socket for read operations and consumer socket in case of write operations. I find that you have used a producer socket for write operations. Please modify this and try out.
- Also, let me know between what sockets is the glChHandleBulkLp DMA channel created.
In CyU3PSdioExtendedReadWrite() APi, I tried producer socket for write operations, but it is throwing an error "CY_U3P_ERROR_DEVICE_BUSY" (0x7C).
And Socket between DMA channel is as below:
dmaCfg.prodSckId = CY_U3P_UIB_SOCKET_PROD_1;
dmaCfg.consSckId = CY_U3P_SIB_SOCKET_1;
is any changes are required in the descriptor.h file?
I also followed the below steps:
1. Created an auto DMA channel between UIB producer and Storage consumer (say socket 1).
2. While creating, set the DMA to call back with CY_U3P_DMA_CB_RECV_CPLT notification, but CY_U3P_DMA_CB_PROD_EVENT is notifying not CY_U3P_DMA_CB_RECV_CPLT
3. In the callback function, I am setting a RxFlag
4. Looking for this RxFlag in Thread infinite for loop. When the flag is set to call CyU3PSdioExtendedReadWrite() API with consumer storage socket (i.e. socket 1)
Still, Problem is the same
I have attached full project, please look into
FX2SSdioUart.zip 577.1 K
CY_U3P_DMA_CB_RECV_CPLT and CY_U3P_DMA_CB_SEND_CPLT events will trigger when you operate DMA in override mode using CyU3PDmaChannelSetupRecvBuffer and CyU3PDmaChannelSetupSendBuffer API.
Note that you should not call CyU3PDmaChannelSetXfer API after creating the DMA Channel.
Since you are calling CyU3PDmaChannelSetXfer after creating the DMA Channel and you are not using CyU3PDmaChannelSetupRecvBuffer API, therefore, CY_U3P_DMA_CB_RECV_CPLT is not triggered.
This is implemented to MSC example firmware.
Please refer the attachment for DMAOverride details.
The DMA_CB_PROD_EVENT or DMA_CB_CONS_EVENT triggers when the DMA Channel type is AUTO_SIGNAL/ MANUAL mode. You will not received DMA_CB_PROD_EVENT or CONS_EVENT in DMA_AUTO mode.
In MANUAL DMA Channel, you need to commit the DMA Channel using commitbuffer API, so that the buffer will be available for consumer.
Please refer table 5.2 and section 7.1 for DMA examples in FX3_Programmers manual for more details on DMA Channel types and its configuration.
DMAOverride_1.pdf 259.8 K