End of frame should be more than 2048 for UVC example in ISO mode

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

cross mob
Anonymous
Not applicable

In both of USB2.0 and USB3.0 specification, 3*1024 transfers are possible in one isochronous micro frame, so if you implement UVC example in ISO mode with FX3, you should make sure that there are more than 2049 bytes available in the buffer committed to USB, the reason is shown in the forum: http://www.cypress.com/?app=forum&id=167&rID=69873.

   

 

   

Different image resolutions and bit depths cause different size of data payloads in the end of frame buffer.

   

For example,

   

here create GPIF II project 640x480 pixels; 30fps; 16 bits per pixel 

   

Hence, total bytes per frame = 640*480*2 = 614400.

   

In firmware, DMA buffer size is 3*1024 (3072 bytes) included 12 bytes header and 4 bytes footer, actually, the producer buffer size should be 3072-12- 4 = 3056.

   

Since each micro frame will send out 3056 bytes of pixel data, it will take 202 micro frames to transmit all data 614400 bytes.

   

The first 201 micro frames are full with 3072 bytes, and the last micro frame only has 144 byte.

   

In order to leave more than 2048 bytes in the last micro frame, we commit the buffer when 3046 bytes are received.

   

In above condition, we will commit 3046 bytes in each micro frame, and the count is 201, and then we will get the 2154 in the last micro frame.

   

201*3046 +2154 = 614400.

   

 

   

In Cypress UVC ISO project, set CY_FX_UVC_BUF_FULL_SIZE =  3046 for this resolution.

0 Likes
1 Reply
Anonymous
Not applicable

Try it

0 Likes