- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I use CyU3PDmaChannelCreate() create 3 dma channel:
(1)CY_U3P_PIB_SOCKET_0 as producer and CY_U3P_CPU_SOCKET_CONS as consumer socket.
(2)CY_U3P_PIB_SOCKET_1 as producer and CY_U3P_CPU_SOCKET_CONS as consumer socket.
(3)CY_U3P_CPU_SOCKET_PROD as producer and CY_U3P_UIB_SOCKET_CONS_3 as consumer socket.
for above 3 dma channel, I config CyU3PDmaChannelConfig_t struct param : size = 32768, count = 2, dmaMode = CY_U3P_DMA_MODE_BYTE.
And I config same callback function for (1) and (2) dma channel.
In DMA callback, I get buffer by CyU3PDmaChannelGetBuffer(), then use CyU3PDmaChannelCommitBuffer() to send buffer. But when I get buffer for the fourth time, CyU3PDmaChannelGetBuffer() return error code 0x45. What my problem?
I also have another question: what dose CyU3PDmaChannelDiscardBuffer() do? Should I use CyU3PDmaChannelDiscardBuffer() after commit buffer?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The 0x45 error (time out error) is returned CyU3PDmaChannelGetBuffer() API because there are no PROD events (no data coming from PIB) until the timer overflows.
The CyU3PDmaChannelDiscardBuffer() will Drop a data buffer without sending out to the consumer. It won't be useful to use this API after commit buffer because both the APIs are contradictory.
The commit buffer API commits the buffer data to consumer socket whereas CyU3PDmaChannelDiscardBuffer() drops the data and doesn't send it to consumer.
Also confirm that two DMA channels are made PIB 0>CPU and PIB1 >CPU, is the channel creation proper because the CPU has only one consumer socket
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The 0x45 error (time out error) is returned CyU3PDmaChannelGetBuffer() API because there are no PROD events (no data coming from PIB) until the timer overflows.
The CyU3PDmaChannelDiscardBuffer() will Drop a data buffer without sending out to the consumer. It won't be useful to use this API after commit buffer because both the APIs are contradictory.
The commit buffer API commits the buffer data to consumer socket whereas CyU3PDmaChannelDiscardBuffer() drops the data and doesn't send it to consumer.
Also confirm that two DMA channels are made PIB 0>CPU and PIB1 >CPU, is the channel creation proper because the CPU has only one consumer socket
Regards,
Rashi
Rashi