prevent CyU3PDmaMultiChannelCommitBuffer fail with error code 71

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

cross mob
Anonymous
Not applicable

Hi,

   

I modified the ap note AN75779 from UVC interface to bulk datastream. The CyU3PDmaMultiChannelCommitBuffer function will often fail with error code 71 when PCLK frequency is increased. I have try to increase DMA buffer as possible, but the problem still exists. The most serious is sometime when this error happens, USB bus will hang even I have do DMA reset already.

   

I want to know if there any reliabiliy (checking) method to prevent commit buffer fail, or recovery method if the error happens. I ever tried to get the multidma status or to count the prod and cons packets to discard dma buffer, but not help.

0 Likes
4 Replies
Anonymous
Not applicable

This can happen when the writing goes out of sequence.

   

 

   

Since you're producing data at higher rates, many buffers may have been produced when you enter the callback. You can therefore commit all of the using CyU3PDmaMultiChannelGetBuffer as a check.

   

i.e in pseudocode, 

   
returnStatus = CyU3PDmaMultiChannelGetBuffer(...)  while(returnStatus == CY_U3P_SUCCESS) {          // do the usual header addition and commit          returnStatus = CyU3PDmaMultiChannelGetBuffer(...);  }
0 Likes
Anonymous
Not applicable

Dear scutifer,

   

Sorry I didn't mention clearly. I check the dma status in the thread, not in the callback. My pseudocode is as below. Is there any function call I may use before commit buffer?

   
void BulkLpAppThread_Entry (uint32_t input){  for(;;){   stat = CyU3PDmaMultiChannelGetBuffer (...);   if (stat == CY_U3P_SUCCESS){     //add header to buffer        //check if safe to commit buffer, or to discard buffer here        stat = CyU3PDmaMultiChannelCommitBuffer (....);    if (stat != CY_U3P_SUCCESS){     // handle the commit error    }   }  } } 
0 Likes
Anonymous
Not applicable

By the way, I guess the error will happen is because the dma buffer is full. Why I think so is after I modify the data received method from the synchronise mothed to asynchronise in the pc software, the rate of error occurrence was decrease. I ever try to create a producer and consumer counter to trace the buffer level, but does not successfully prevent the error.

   

    

0 Likes
Anonymous
Not applicable

Hi everyone,

   

 

   

I've got the same error with the example AN75779.

   

 

   

Does anyone solve this problem?

   

 

   

Best regards.

0 Likes