Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Maximum DMA Buffer sizes for USB 2.0 and USB 3.0 different?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Maximum DMA Buffer sizes for USB 2.0 and USB 3.0 different?
Moderator:
RSKV

Post Reply
Follow this topic



Maximum DMA Buffer sizes for USB 2.0 and USB 3.0 different?

Sil posted on 26 Jul 2012 5:33 AM PST
Top Contributor
93 Forum Posts

Hello

 

According to my understanding there is 256 kB memory available for DMA buffers by default. In my application I create two DMA channels each with count=1 and size = USB packet size. In addition, I want to create a MultiDMA upstream channel (2 to one) that uses all the remaining memory available. For USB 3.0 I am using count=126 and size=1024 (126*1024*2=252 kB) for the MultiDMA channel, which is working. However, when connected to a USB 2.0 host, I would like to use count=252 and size=512 (252*512*2=252 kB) but the DMAMUltiChannelCreate function returns "16" which means "CY_U3P_ERROR_MEMORY_ERROR". After some try and error, I found that maximum count value for USB 2.0 seems to be around 80, which results in only 82 kB buffer size. What can be the reason for this?

 

-Silvio




Re: Maximum DMA Buffer sizes for USB 2.0 and USB 3.0 different?

RSKV posted on 03 Aug 2012 12:08 AM PST
Cypress Employee
655 Forum Posts

There are two reasons why a CyU3PDmaChannelCreate (or CyU3PDmaMultiChannelCreate) API returns the CY_U3P_ERROR_MEMORY_ERROR code. 

  1. DMA buffer allocation failure
  2. DMA buffer descriptor allocation failure: The buffer descriptors are structures that keep track of the size and state of each DMA buffer. There are a total of 512 descriptors available on the system. Each buffer requires one descriptor in the case of AUTO channels, and two descriptors in the case of MANUAL channels. 

In your case, the attempt to create a multichannel with a count of 252 would fail because the a MANUAL multichannel with a count of 252 will require 1008 descriptors. There is no dependency on the USB connection speed. We have verified that we are able to create DMA channels with a count 126 in both 2.0 and 3.0 cases.




Re: Maximum DMA Buffer sizes for USB 2.0 and USB 3.0 different?

Sil posted on 03 Aug 2012 12:33 AM PST
Top Contributor
93 Forum Posts

This makes sense. So I will increase the DMA buffer size to get around this problem. Thanks for letting me know.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.