[FX3] Manual DMA buffer don't need to send to PC

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HuYa_4249091
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi, I've studied the AN75779, and knew the mechanism for manual DMA callback.

If I only want to analyze the data which is received by manual DMA socket inside FX3, and don't need to send to PC.
It means that I only need to call CyU3PDmaMultiChannelGetBuffer( ) and don't call CyU3PDmaMultiChannelCommitBuffer( ) in DMA callback function.

Q1: In my understanding, the locked DMA buffer will unlock until the CyU3PDmaMultiChannelCommitBuffer( ) is called and the PC have received the content on this DMA buffer. Is my understanding correct?

Q2: If the answer for Q1 is yes. Then how can I unlock the DMA bufferIf, if I don't call CyU3PDmaMultiChannelCommitBuffer( )?

PS. I knew the CyU3PDmaMultiChannelDiscardBuffer( ) can discard the DMA buffer. However, in my test, it's only valid before the CyU3PDmaMultiChannelGetBuffer( ). Therefore, I guest the function isn't suitable in my case.

Any help will be highly appreciated!
Hughes

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Hughes,

Please find my comments below

Q1: In my understanding, the locked DMA buffer will unlock until the CyU3PDmaMultiChannelCommitBuffer( ) is called and the PC have received the content on this DMA buffer. Is my understanding correct?

>>  Please let me know the meaning of locked here. From the description, I understand that DMA buffer will not be free unless Consumer sockets consumes the data after commit buffer (CyU3PDmaMultiChannelCommitBuffer) is called. If that is what you meant then your understanding is correct.

 

Q2: If the answer for Q1 is yes. Then how can I unlock the DMA bufferIf, if I don't call CyU3PDmaMultiChannelCommitBuffer( )?

>> As you are aware to free up the DMA buffer without committing the DMA buffer to the consumer socket, CyU3PDmaMultiChannelDiscardBuffer can be used.

 

PS. I knew the CyU3PDmaMultiChannelDiscardBuffer( ) can discard the DMA buffer. However, in my test, it's only valid before the CyU3PDmaMultiChannelGetBuffer( ). Therefore, I guest the function isn't suitable in my case.

>> Please let me know what problem is seen while calling CyU3PDmaMultiChannelDiscardBuffer is called after CyU3PDmaMultiChannelGetBuffer. Please share the code snippet with the implementation. In the FX3 SDK example bulklpmaninout the DMA buffer is copied and then discarded. Please refer to the example and let me know if you have similar application. 

Regards,
Rashi

View solution in original post

1 Reply
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Hughes,

Please find my comments below

Q1: In my understanding, the locked DMA buffer will unlock until the CyU3PDmaMultiChannelCommitBuffer( ) is called and the PC have received the content on this DMA buffer. Is my understanding correct?

>>  Please let me know the meaning of locked here. From the description, I understand that DMA buffer will not be free unless Consumer sockets consumes the data after commit buffer (CyU3PDmaMultiChannelCommitBuffer) is called. If that is what you meant then your understanding is correct.

 

Q2: If the answer for Q1 is yes. Then how can I unlock the DMA bufferIf, if I don't call CyU3PDmaMultiChannelCommitBuffer( )?

>> As you are aware to free up the DMA buffer without committing the DMA buffer to the consumer socket, CyU3PDmaMultiChannelDiscardBuffer can be used.

 

PS. I knew the CyU3PDmaMultiChannelDiscardBuffer( ) can discard the DMA buffer. However, in my test, it's only valid before the CyU3PDmaMultiChannelGetBuffer( ). Therefore, I guest the function isn't suitable in my case.

>> Please let me know what problem is seen while calling CyU3PDmaMultiChannelDiscardBuffer is called after CyU3PDmaMultiChannelGetBuffer. Please share the code snippet with the implementation. In the FX3 SDK example bulklpmaninout the DMA buffer is copied and then discarded. Please refer to the example and let me know if you have similar application. 

Regards,
Rashi