cannot reach the target speed

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

cross mob
Philip
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins

Hello,

Our module features below:
- MIPI Rate: 480(MHz)
- MIPI Lane: 4Lane
However, we cannot reach the maximum bitrate.

Philip_0-1621241794958.png

 


Out MIPI Receiver Configuration is below:

Philip_1-1621242483604.png

and DMA buffer settings are below:

#define CX3_UVC_DATA_BUF_SIZE (0x9000) /* DMA Buffer Data Size Used: 24576 Bytes*/
#define CX3_UVC_STREAM_BUF_COUNT (2)

And we use non-uvc and 24bit output video format.

I think the transfer rate is too low.
How can I test the maximum bitrate?

Regards,
Philip

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Editted

Hello Philip,

Thank you for sharing the information.

I still find that there is a difference between the expected data rate and the one shown in the streamer Application. I strongly suspect that the sensor is not configured correctly. I find that the same is discussed in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/How-to-set-CX3-mipi-receiver-configurati...

Please check the sensor configuration settings once again.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
7 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello Philip,

The MIPI Receiver Configuration seems to be proper. From the MIPI Receiver configuration tab of the CX3 configuration utility, I understand that the resolution of the video frame is 1280*480. From this, the data rate can be calculated as follows:

Data rate = 1280*480*12*30 = 221184000 bits per second = 27000KBps

But, from the streamer, I can see that the transfer rate is 70200KBps which is different from the expected data rate. As you might be knowing, CX3 is a bridge between an image sensor and host. It just transfers the data received from the image sensor to the host. As there is a difference between the calculated data rate and the data rate measured by streamer, we suspect that the image sensor might not be configured correctly. 

Please let us know the following details to debug this issue further:

1. Is the project based on the one shared in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/FX3-CX3-Firmware-for-Streaming-RAW-Image...

Also, please share the firmware after removing the sensor configuration parameters so that we can check at our end.

2. Please let us know how is the video stream started and stopped.

3. Are you using a custom board or the Denebola kit?

4. Please share the UART debug logs.

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.

Hello Jayakrishna,
Thank you for your response.

I was mistaken and wrote it wrong.
Correcting the sensor specifications are as follows:
 - Resolution: 1280x480
 - Depth of bits: 12
 - Bitrate: 120
Therefore, Data rate should be 1280*480*12*120 = 8847366000 bits per second = 110,592KBps

Philip_1-1621564585271.png

Please let us know the following details to debug this issue further:

1. Is the project based on the one shared in the following thread:
  => yes, it is. it's based on the source named "CX3_RAWData_Cypress Driver and Descriptors.zip" and we will share our source code. Please refer to the end of the post.

2. Please let us know how is the video stream started and stopped.
  =>  We use Vendor command 0x99 to start the streaming and 0x88 to stop the streaming.

3. Are you using a custom board or the Denebola kit?
  => We use our custom board.

4. Please share the UART debug logs.
  =>
Event Type - 4: CY_U3P_USB_EVENT_CONNECT
MipiErrorThread Init.
Event Type: CY_U3P_USB_EVENT_SUSPEND
Event Type - 2: CY_U3P_USB_EVENT_RESET
Event Type - 3: CY_U3P_USB_EVENT_DISCONNECT
Event Type - 4: CY_U3P_USB_EVENT_CONNECT
AppInit:GpifSMStart passed
Event Type - 1: CY_U3P_USB_EVENT_SETCONF
Event Type - 2: CY_U3P_USB_EVENT_RESET
Event Type - 3: CY_U3P_USB_EVENT_DISCONNECT
Event Type - 4: CY_U3P_USB_EVENT_CONNECT
bRType = 0xC0, bRequest = 0xA0, wValue = 0xE600, wIndex = 0x0, wLength= 0x1
Sleep!
EnterSuspendMode Status = 0x0, Wakeup reason = 8
Event Type - 2: CY_U3P_USB_EVENT_RESET
Event Type - 3: CY_U3P_USB_EVENT_DISCONNECT
Event Type - 4: CY_U3P_USB_EVENT_CONNECT
Event Type - 1: CY_U3P_USB_EVENT_SETCONF
Event Type - 2: CY_U3P_USB_EVENT_RESET
Event Type - 3: CY_U3P_USB_EVENT_DISCONNECT
Event Type - 4: CY_U3P_USB_EVENT_CONNECT
bRType = 0xC0, bRequest = 0xA0, wValue = 0xE600, wIndex = 0x0, wLength= 0x1
bRType = 0x40, bRequest = 0x99, wValue = 0x0, wIndex = 0x0, wLength= 0x200
AplnStrt:SMState = 0x2
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
Start !
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
Video timer
AplnStop:SMState = 0x7
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
Prod = 24 Cons = 23 Prtl_Sz = 312 Frm_Cnt = 345 Frm_Sz = 885048 B
TimeDiff = -460 ms FPS = 0
crcErrCnt:0 ctlErrCnt:0 eidErrCnt:0 frmErrCnt:0 mdlErrCnt:0 recSyncErrCnt:0 recrErrCnt:0
unrSyncErrCnt:255 unrcErrCnt:0


Thank you

Regards,
Philip

0 Likes

Hello Philip,

I did not find the CX3 configuration utility along with the project shared. So, please share the snapshot of the CX3 Receiver configuration tab of MIPI configuration utility so that we can check if the configurations are correct or not. 

After referring to the project, I understand that when the vendor command 0x99 is received, the CX3's MIPI block is configured with the settings defined by the structure cfgNonUvcVgaNoMclk and the sensor is configured by the function CyCx3_CUSTOM_ImageSensor_Set_Vga (). Please confirm if this is the right combination to configure the CX3's MIPI block and sensor for the required video stream.

In addition to these, please share the following details:

1. Snapshot of the streamer application while doing the last test. This is requested because I find that you have changed the parameters of video stream.

2. Was the streamer started before sending the vendor command or after sending the vendor command? Please share all the steps used for streaming in order. 

3. Please share the complete UART debug logs. You can log it using tera term and share the text file with us. I feel that the one shared in your previous response is truncated.

4. Is the device enumerating as USB 2.0 device? This is because I find lot of Suspend and Reset events in the UART debug logs.

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.

Hello Jayakrishna,
Thanks for your immediate response.

I'm sorry, CX3 Receiver configuration tab of MIPI configuration utility was missing, I will share the project again.

1.
Below is a snapshot of the streamer application.
The reason for the increase in the number of "Failures" is because the streamer was started before the vendor command was sent.

Philip_1-1621576583513.png

2.
Previously, after sending the vendor command, the streamer was started.
However, unnecessary logs are left in this case as below.
------------------------------------------------------------------------
CB failure
AplnStop:SMState = 0x5
AplnStrt:SMState = 0x1
CyU3PMipicsiWakeup() ret = 0x0
CyCx3_CUSTOM_ImageSensor_Wakeup() ret = 0x0
------------------------------------------------------------------------
So this time, after starting the streamer, the vendor command was sent.

3.
We attached UART debug logs. Please refer to it.

4.
I checked the device again and it's a USB 3.0 device as below.

Philip_0-1621574153078.png


Thanks again for the answer.

Regards,
Philip

0 Likes
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello Philip,

Please find my comments below:

1. Regarding the settings populated in the MIPI configuration Utility:

a. The CSI clock setting cannot be greater than 300MHz when 4 lanes are used. The same is documented in Q13 of the following KBA:

https://community.cypress.com/t5/Knowledge-Base-Articles/CX3-Firmware-Frequently-Asked-Questions-KBA...

b. Please use the following settings instead of your current settings:

     1. Change the PLL Out range to 250M-500M

     2. Change the Multiplier of Unit clock to 90

     3. Output parallel clock divider and CSI RX clock divider can be changed to 4.

2. Regarding the streamer:

a. As per my understanding, you are starting the streamer first. After this, vendor command is issued. Please confirm if my understanding is correct or not.

b. Currently, I can see that the data rate is just 3400KBps. But in the snapshot shared before, the data rate was 70200KBps. Please let me know what is the difference between these 2 test cases.

c. Please try increasing Packets per xfer from 8 to 32 and xfers to queue from 8 to 16

d. Please send the vendor command as soon as the streamer is started. Please do not delay the transmission of vendor command. After this, please let me know if you are seeing failures.

3. UART debug logs:

From the UART debug logs, I find that "Video Timer" is present in the logs. This is seen when the sensor is not sending the data properly. Can you please comment out the macro RESET_TIMER_ENABLE in the cycx3_uvc.h file and then share the UART debug logs again for us to check?

4. Project:

Please try the following modification in the project:

1. Inside the DMA callback function, comment the following lines of code:

		if ((CyU3PUsbGetSpeed() == CY_U3P_SUPER_SPEED) && (doLpmDisable)) {
			CyU3PUsbLPMDisable();
			CyU3PUsbSetLinkPowerState(CyU3PUsbLPM_U0);
			CyU3PBusyWait(200);
			doLpmDisable = CyFalse;

2. Inside the CyCx3UvcApplnStart() function, just above the API CyU3PGpifSMControl(), add the following lines of code:

 

    CyU3PUsbLPMDisable ();
    if (CyU3PUsbGetSpeed () == CY_U3P_SUPER_SPEED)
    {
        CyU3PUsbSetLinkPowerState (CyU3PUsbLPM_U0);
    }

Please try these recommendations and let me know the result. 

Best Regards,
Jayakrishna
0 Likes

Hello Jayakrishna,
Thanks for your help.

1.a.
I understood it.
I changed the settings.
Philip_0-1621831369911.png
MIPI rate of our sensor is 960MHz so I think CSI Clock should be 480.
Am I right?
However, the minimum value of CSI Clock is 505.04.
In this case, is it ok to set a value that is a little bit greater like the above image?

1.b.
I set all of them.

Philip_1-1621831848336.png
However, nothing changes that I can recognize.


2.a. 
You're right.
We started the streamer first and sent the vendor command later.

2.b
I could be related to DMA Settings.
 = > #define CX3_UVC_DATA_BUF_SIZE (0x6000)
 = > #define CX3_UVC_STREAM_BUF_COUNT (2)
However, It cannot be reproduced now.
Below is a snap short of the current Streamer.

Philip_2-1621835875399.png



2.c
Nothing changes.

2.d
There are no failures.

3.
Nothing changes.

4.1 and 4.2
Nothing changes.


Regards,
Philip

0 Likes
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Editted

Hello Philip,

Thank you for sharing the information.

I still find that there is a difference between the expected data rate and the one shown in the streamer Application. I strongly suspect that the sensor is not configured correctly. I find that the same is discussed in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/How-to-set-CX3-mipi-receiver-configurati...

Please check the sensor configuration settings once again.

Best Regards,
Jayakrishna
0 Likes