cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

New Contributor

I have a mipi camera based on CX3 at super speed(USB3.0). It works perfectly in PC but not stable in RK3399(Embedded UBuntu16.04 System). After start-up,it can receive data for some time(several seconds or several minutes). After some time it is blocked. And I find in the firmware  debug log that it reports DMA_RESET_EVENT.

CyU3pDmaMultiChannelCommitBuffer reports 0x47(CY_U3P_ERROR_INVALID_SEQUENCE)  frequently once every second. So increasing the buffer or adding the code to reset GPIF should not work. Does anybody have any solution?

0 Likes
Reply
1 Solution
Moderator
Moderator

Hello,

The basic constraint is that the data coming from the image sensor will be written to some DMA buffers in CX3. If the host is reading data from the USB side at a slower rate, at some point of time the buffer overflows. So it is recommended that the bandwidth from the sensor should be less than that at the USB side.

Please answer my following questions:

1.Please confirm whether you are using USB 2.0 or 3.0 in this project.

2.Please try reducing the frame rate and check whether the same issue occurs again.

3.Please try restarting the application once the failure occurs.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
Reply
7 Replies
Moderator
Moderator

Hello,

This error may occur if the UVC host application does not issue IN tokens fast enough to clear the DMA buffers. Please refer to the following KBA which describes how to recover from this error.

Invalid Sequence Error in Multi-Channel Commit Buffer - KBA218830

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
Reply
New Contributor

I try to increase the DMA buffer or add the process code according to KBA218830, but the problem is not solved. Is there any other solution?I wonder why it works perfectly at first for several seconds or several minutes. But after that time data is blocked and the firmware reports invalid sequence error. Could you give some some clues?

0 Likes
Reply
Moderator
Moderator

Hello,

Please let me know the following information:

1.Are you using an example project provided by Cypress or is it your own firmware?

2.Which host application is used for streaming?

3.Please share the debug logs.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
Reply
New Contributor

1. I use the CX3 configuration tool and specify the sensor-related parameters and the tool itself produces the code. I made some modifications based on the tool-produced code. Because my sensor is a TOF(Time of Flight) sensor, I config and control the sensor through the extension unit. So I mainly add some extension-unit-related processing code. And I can config the sensor  and the sensor can also send out MIPI data. So the code should be right.

2. The sensor is a TOF sensor. Its data cannot be previewed by any viewer software. So I develop the host software by myself. In Linux I mainly use the V4L2 framework and in windows directshow. Because the host application works perfectly in PC under both windows and Linux, so the link from the front to the end should be right. And my host application should also be ok.

3. When it works in RK3399, my host application can receive data in the first several seconds or minutes(sometimes several seconds,sometimes several minutes). After that time it cannot receive any data. And in the firmware it reports repeatedly the errors shown in the following figure. Because it reports the errors once every one or two seconds, increasing the DMA buffer or using the code concerned in the KBA 218830 cannot solve the problem. I have verified this.  I think the cause is that the data transfer speed of USB3.0 at host USB driver side suddenly falls down. But how can I solve the problem?Could you give some clues?

format.jpg

0 Likes
Reply
Moderator
Moderator

Hello,

1.Please confirm whether you are using USB 2.0 or 3.0.

2.Please try reducing the frame rate and check whether the same issue occurs again.

3.Please try restarting the application once the failure occurs.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
Reply
New Contributor

I have a question here.  No matter what the resolution is, my sensor pixel clock is 45MHz, and format of pixel from sensor is RAW12.  So the max MIPI bandwidth is always 45M * 12 = 540Mbps=67MBps. That means no matter what the resolution is, the MIPI bandwidth is fixed at 67MBps.  Does CX3 have such a constraint that the MIPI bandwidth must less than USB bandwidth? If CX3 does not have such a constraint, then I can reduce the resolution and use USB2.0.  Could you confirm this?

0 Likes
Reply
Moderator
Moderator

Hello,

The basic constraint is that the data coming from the image sensor will be written to some DMA buffers in CX3. If the host is reading data from the USB side at a slower rate, at some point of time the buffer overflows. So it is recommended that the bandwidth from the sensor should be less than that at the USB side.

Please answer my following questions:

1.Please confirm whether you are using USB 2.0 or 3.0 in this project.

2.Please try reducing the frame rate and check whether the same issue occurs again.

3.Please try restarting the application once the failure occurs.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
Reply