cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

New Contributor II

Hi

We use cyprss sdk to generate FW of bulk mode uvc and would like to change into FW of isochronous mode uvc. We reference the isochronous sample code to modify the FW. After the modification, the windows (Windows 10) can see the device as a UVC USB 3.0. But when I open the e-cam it doesn't display any video. Could you please let me know what might be causing this issue? I'm also attaching my project with this email. If you can help on this issue would be greatly appreciated.

1 Solution
Moderator
Moderator

Hi Kelvin,

Please test the attached project. This project does not require any image sensor. It just displays some color on the screen. You just have to program the image file into your FX3 explorer kit.

Password for attachment: cypress.

I have tested it and it is working fine.

After you program, FX3 will enumerate as two devices FX3-BULK and FX3-ISOC. In the player you can select FX3-ISOC.

In the firmware I have defined the macro USE_ISOCHRONOUS_ENDPOINT.

You can take a look at the BURST, PAYLOAD SIZE, DMA Buffer Size used in this project as a reference.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
Reply
15 Replies
Moderator
Moderator

Hi,

Please change the following and check:

- In /* Super Speed Endpoint Companion Descriptor */:

the third index is CY_FX_EP_ISO_VIDEO_SS_MULT - 1, where CY_FX_EP_ISO_VIDEO_SS_MULT is defined as 1. Can you please change the define to 2?

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

We try to change the value of CY_FX_EP_ISO_VIDEO_SS_MULT  into 2 but the e-cam also didn't display any video.

attach more information for this issue:

1.image size : 1280*960

2.format : RGB888

3.total data size per frame :  3686400 byte

4.endpoint descripor and companion:

/* Endpoint Descriptor for Isochronous Streaming Video Data */

    0x07,                                                             /* Descriptor size */

    CY_U3P_USB_ENDPNT_DESCR,             /* Endpoint Descriptor Type */

    0x83,                            /* Endpoint address and description: EP 3 IN */

    0x01| 0x04,                                                  /* Isochronous End point */

    0x00,

    0x04,                                                            /* Max packet size is 1024 bytes. */

    0x01,                                                           /* Servicing interval for data transfers */

    /* Super Speed Endpoint Companion Descriptor */

     0x06,                                 /* Descriptor size */

     0x30,                                /* SS Endpoint Companion Descriptor Type */

     3- 1,                                  /* Max no. of packets in a burst */

     2- 1,                                 /* Mult setting: Number of bursts per service interval. */

     0x00,

     0x04 * 3                          /* Bytes per interval : 1024 */

5.endpoint config :

     /* Setup the Isochronous endpoint used for Video Streaming */

     endPointConfig.enable  = CyTrue;

     endPointConfig.epType  = CY_U3P_USB_EP_ISO;

     endPointConfig.pcktSize = CY_FX_EP_ISO_VIDEO_PKT_SIZE;

     endPointConfig.streams = 0;

     if (CyU3PUsbGetSpeed () == CY_U3P_SUPER_SPEED)

     {

     endPointConfig.isoPkts  = CY_FX_EP_ISO_VIDEO_SS_MULT;

     endPointConfig.burstLen = CY_FX_EP_ISO_VIDEO_SS_BURST;    

     }

     else

     {

     /* Set the ISOMULT to 1 by default. This will be updated to the correct value when we start streaming data. */

     endPointConfig.isoPkts  = 1;

     endPointConfig.burstLen = 1;

     }

6.Dma config :

dmaCfg.size = 3*0400;

dmaCfg.count = 10;

dmaCfg.validSckCount = 2;

dmaCfg.prodSckId[0]  = CX3_PRODUCER_PPORT_SOCKET_0;

dmaCfg.prodSckId[1]  = CX3_PRODUCER_PPORT_SOCKET_1;

dmaCfg.consSckId[0] = (CY_U3P_UIB_SOCKET_CONS_0 | (CY_FX_EP_ISO_VIDEO & 0x7F));

dmaCfg.dmaMode = 0;

dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;;

dmaCfg.cb = CyCx3UvcAppDmaCallback;

dmaCfg.prodHeader = 0;

dmaCfg.prodFooter = 0;

dmaCfg.consHeader = 0;

dmaCfg.prodAvailCount = 0;

The e-cam screen image is shown below and the attachment(cyfxuvcinmem.rar) is our reference sample code.

e-cam.png

0 Likes
Reply
Moderator
Moderator

Hi,

- Change the define of CY_FX_EP_ISO_VIDEO_SS_MULT back to 1.

- Make the 'Bytes per interval' field of Super speed companion descriptor as

0x00, 0x04 * (CY_FX_EP_ISO_VIDEO_SS_MULT) * (CY_FX_EP_ISO_VIDEO_SS_BURST)  //This is 3KB in your case

- UVC Probe control settings should be updated with the maximum payload size calculated using BURST length and MULT settings. The maximum payload size should be (CY_FX_EP_ISO_VIDEO_SS_BURST) * (CY_FX_EP_ISO_VIDEO_SS_MULT) * (Max Endpoint size).

- According the firmware that you have shared, UVC headers are not being added by CX3. So, they must be added by an FPGA? - Please confirm. If yes, then there is no need to call CyCx3UvcAppAddHeader()

- Please remove DebugPrints in DmaCallback.

Regards,

Hemanth

Hemanth
New Contributor II

Hi Hemanth

We can see the video in e-cam. but we have question.

What do CY_FX_EP_ISO_VIDEO_SS_MULT and CY_FX_EP_ISO_VIDEO_SS_BURST have any conditions or restrictions to set?

kelvin

0 Likes
Reply
Moderator
Moderator

Hi Kelvin,

- As you might already know that according to USB spec, the maximum value that can be reported  for mult and burst fields of super speed companion descriptor are 2 and 15 respectively.

Let us assume you have reported CX3_EP_ISO_VIDEO_SS_BURST as the burst value in the descriptor and CX3_EP_ISO_VIDEO_SS_MULT as the mult value, then

1. wBytesPerInterval field(the last one in the endpoint companion descriptor) should be 0x00, 0x04 * (CX3_EP_ISO_VIDEO_SS_MULT + 1) * (CX3_EP_ISO_VIDEO_SS_BURST + 1) //Assuming your max endpoint size is 1024.

2. The maximum payload size in the probe control structure should be (CY_FX_EP_ISO_VIDEO_SS_BURST+1) * (CY_FX_EP_ISO_VIDEO_SS_MULT+1) * (Max Endpoint size).

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

if we follow the rule that you offer for us, the video didn't be displayed in e-cam.

max endpoint size : 0x400

the maximum payload size : 0x9000

According to the rule, the parameters value will be set as below:

CY_FX_EP_ISO_VIDEO_SS_MULT : 2

CY_FX_EP_ISO_VIDEO_SS_BURST : 0x0b

Is there something wrong with this setting?

Thank for your answer.

kelvin

0 Likes
Reply
Moderator
Moderator

Hi kelvin,

Did you also change the DMA buffer size in your application to 0x9000 (which is necessary)?

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

The DMA buffer size is 0x8FD0 but we try to modify the value into 0x8FF0.

dmaCfg.size = 0x8FF0 + 12 + 4(header length)

dmaCfg.count  = 3

The result is the same as before.

kelvin

0 Likes
Reply
Moderator
Moderator

Hi Kelvin.

Please attach your project(after changing it for 36KB). Let me have a look.

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

The attachment is our sample code.

kelvin

0 Likes
Reply
Moderator
Moderator

Hi kelvin,

- Are you testing in Windows 10 (If not please test in Windows 10)

- Are you getting producer events (You can see this in UART log). Also can you check if there are any errors in UART log?

(Does the number of producer events generated(few full buffers +one last partial buffer) for one frame match with the frame size that you are streaming)

- When the payload size of 3KB worked, did you make any changes other than which I had mentioned?

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

1.yes. Our operation system is Windows 10.

2.There are no errors in UART log. The log is shown as below.

1280*960*3 = 3686400 B

Prod = 100 Cons = 100  Prtl_Sz = 4800 Frm_Cnt = 887 Frm_Sz = 3686400 B

3.We update the cypress SDK so the DMA buffer size is modified to 0x8FD0 by new SDK.

kelvin

0 Likes
Reply
Moderator
Moderator

Hi Kelvin,

Let me summarize as below:

Working:

1. CY_FX_EP_ISO_VIDEO_SS_MULT =0 (Note that this is the value directly mentioned in descriptors not one less of this)

2. CY_FX_EP_ISO_VIDEO_SS_BURST =0x02 (Note that this is the value directly mentioned in descriptors not one less of this)

3. maximum payload size in the probe control structure = 3KB

4. DMA buffer size = 3KB

Please confirm if the above configuration is working fine. What resolution and pixel depth have you tested the configuration with?

Not-working:

1. CY_FX_EP_ISO_VIDEO_SS_MULT = 2

2. CY_FX_EP_ISO_VIDEO_SS_BURST = 0x0B

3. maximum payload size in the probe control structure = 36KB

4. DMA buffer size = 0x8FF0 +16

Please confirm that the above is the configuration that is not working.

Please also try the below:

1. CY_FX_EP_ISO_VIDEO_SS_MULT = 2

2. CY_FX_EP_ISO_VIDEO_SS_BURST = 0x0E

3. maximum payload size in the probe control structure = 45KB

4. DMA buffer size = 0x8FF0 +16 (36KB)

Regards,

Hemanth

Hemanth
0 Likes
Reply
New Contributor II

Hi Hemanth

working:

1. CY_FX_EP_ISO_VIDEO_SS_MULT = 0

2. CY_FX_EP_ISO_VIDEO_SS_BURST = 0x09

3. maximum payload size in the probe control structure = 36KB(0x9000)

4. DMA buffer size = 0x8FD0 +16

image resolution : 1280*960

pixel depth : 3 (RGB888)

Not-working:

1. CY_FX_EP_ISO_VIDEO_SS_MULT = 2

2. CY_FX_EP_ISO_VIDEO_SS_BURST = 0x0E

3. maximum payload size in the probe control structure = 45KB(0xb000)

4. DMA buffer size = 0x8FF0 +16 (36KB)

kelvin

0 Likes
Reply
Moderator
Moderator

Hi Kelvin,

Please test the attached project. This project does not require any image sensor. It just displays some color on the screen. You just have to program the image file into your FX3 explorer kit.

Password for attachment: cypress.

I have tested it and it is working fine.

After you program, FX3 will enumerate as two devices FX3-BULK and FX3-ISOC. In the player you can select FX3-ISOC.

In the firmware I have defined the macro USE_ISOCHRONOUS_ENDPOINT.

You can take a look at the BURST, PAYLOAD SIZE, DMA Buffer Size used in this project as a reference.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
Reply