CyU3PDmaMultiChannelReset for CYUSB3014

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

cross mob
BNPE1234
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi, I am using CYUSB3014 to stream live images to the PC using a bulk endpoint. I get error 997 for WaitForXfer , FinishDataXfer. Also I get USB underrun error in the firmware. 

I am using DMA in manual many to one having two GPIF as the producers and one USB  (CY_U3P_UIB_SOCKET_CONS_1) as the consumer. There are two buffers per sockets. When there are some errors I like to reset the whole stream of the data. The code I return resets the GPIF using CyU3PGpifSMSwitch to go to start state then I run the followings:

  1. CyU3PDmaMultiChannelAbort
  2. CyU3PUsbFlushEp
  3. CyU3PDmaMultiChannelReset
  4. CyU3PDmaMultiChannelSetXfer
  5. CyU3PGpifControlSWInput, I use this to resume the GPIF to generate the data and starts to commit them.

The thing is when I run the above I can see the call back for the DMA is being called four times saying there consumer event. I am wondering why when I run the above the call back for the DMA is being called four times.

 

Thanks 

Behzad

 

 

 

 

 

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Issue solved by keeping the reset DMA/USB function out of the DMA callback.

Regards,
AliAsgar

View solution in original post

0 Likes
5 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Behzad,

I assume the transition from start state (IDLE) to the next state is through a FW_TRG. Is my assumption correct?

Could you try following a different order for API calls for reset:

  1. CyU3PGpifSMSwitch 
  2. CyU3PUsbFlushEp
  3. CyU3PDmaMultiChannelReset
  4. CyU3PDmaMultiChannelSetXfer
  5. CyU3PGpifControlSWInput

Let me know if you are able to reset with the above steps and there are no DMA callbacks seen.

Best Regards,
AliAsgar

0 Likes
BNPE1234
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi AliAshgar,

Thanks for the quick reply, I tried what you said and I still have the same problem. I attached the GPIF project and the source code for the streaming call back I have.   The things i observe is when i tried with your suggestion Iget USB underrun error a lot mode. The way it was before it get less USB under run error. Actually this USB under run error is my main problem.  

 

Thanks for looking at this issue. 

0 Likes
BNPE1234
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi AliAsgar,

I moved the zip file to the techsupport : IFX-221221-791502, since it is more private and it is better for us to not share our source codes to the public domain. 

thanks 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

In that case, let us continue our discussion on IFX-221221-791502 itself.

Best Regards,
AliAsgar

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Issue solved by keeping the reset DMA/USB function out of the DMA callback.

Regards,
AliAsgar

0 Likes