cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

SimonP
New Contributor II

Hi,

I finally got all the information from the camera supplier and filled the 'Image Sensor Configuration' tab in the CX3 MIPI Receiver Configuration.

When I switch to the 'CX3 Receiver Configuration' tab, I get the two following errors :

CX3_MIPI_Receiver_Configuration_Error.png

Min/Max values don't make sense so I don't know how to fix these errors ?

I still tried to use the resulting configuration but I only get black screen.

Any idea how to make this interface work ?

Best regards,

SimonP

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Based on your configurations, the total data rate can be calculated as follows:

Data rate = hres x vres x bits per pixel x frame rate

Data rate = 2600 *  1952 * 16 * 60 = 4.53Gbps (approximately)

I assume that you are padding the incoming data into 16 bits. This is the reason why I have used 16 as bits per pixel in the above calculation.

Please note that CX3 can only support a maximum of 2.4Gbps. So, this configuration cannot be supported by CX3. Please choose another configuration so that the data rate is less than 2.4Gbps

Also, please refer to Q13 of the following KBA which mentions the maximum value that can be set for the CSI clock when different number of data lanes are used:

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

The CSI clock setting used in your configuration is also not supported by CX3 for 4 lanes.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
15 Replies
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Based on your configurations, the total data rate can be calculated as follows:

Data rate = hres x vres x bits per pixel x frame rate

Data rate = 2600 *  1952 * 16 * 60 = 4.53Gbps (approximately)

I assume that you are padding the incoming data into 16 bits. This is the reason why I have used 16 as bits per pixel in the above calculation.

Please note that CX3 can only support a maximum of 2.4Gbps. So, this configuration cannot be supported by CX3. Please choose another configuration so that the data rate is less than 2.4Gbps

Also, please refer to Q13 of the following KBA which mentions the maximum value that can be set for the CSI clock when different number of data lanes are used:

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

The CSI clock setting used in your configuration is also not supported by CX3 for 4 lanes.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

I understand and updated my camera configuration to a framerate of 15 fps, 2 data lanes and a CSI clock of 495MHz but I still get the same errors :

SimonP_0-1634140512645.png

What am I missing here ?

Best regards,

SimonP

0 Likes
SimonP
New Contributor II

Hi Jayakrishna,

Any update on this topic ?

I made another configuration with an even slower bitrate :

SimonP_0-1634544961958.png

I still have the same errors but I got a configuration when switching to the MIPI configuration tab (cyu3mipicsi.c). Is it usable?

I also looked at the USB interface (cycx3_uvcdscr.c) and I get this message :

SimonP_1-1634545268539.png

The new configuration has a bitrate of 450Mbps which is lower than the maximum data rate of the USB2.0. How can I fix this ?

Best regards,

SimonP

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Apologies for the delayed response.

Please find my comments for the first snapshot that was shared on Oct 13 below:

CX3 can support a maximum of 100MHz as output PCLK. It is not possible to configure the output PCLK above 100MHz. Here, as shown by the tool, you need a minimum of 170MHz PCLK to support this resolution. This is not supported by CX3. So, you can try to pack the incoming data into 24 bits. To do this, please change the Output Video Format setting in Image Sensor Configuration tab of MIPI configuration utility to 24 bits. Please note that packing of incoming data into 24 bits is supported only if the line size is divisible by 24 bits. Here, the line size can be calculated as follows:

Line size = 2600 x 10 = 26000 bits

The above line size is not divisible by 24 bits. So, this resolution cannot be packed into 24 bits. You can try using 2616 instead of 2600.

You can refer to the following KBA to understand the changes to be made on the descriptors when the incoming data is packed into 24 bits:

https://community.cypress.com/t5/Knowledge-Base-Articles/Streaming-RAW10-Format-Input-Data-to-16-24-...

Please find my comments for the second snapshot that was shared on Oct 18 below:

Here, the error that is seen in the Output PCLK is a bug in the CX3 configuration utility. We are aware of this bug and it will be fixed in the upcoming release of FX3 SDK. But, the error in THS-Prepare is an actual error. You need to set it above 44.04ns as suggested by the tool. 

The theoretical bandwidth of USB 2.0 is 480Mbps. But, practically the bandwidth will be less than 480Mbps. CX3 supports around 35-40MBps (Mega bytes per second) only for USB 2.0. It could be due to this reason that the tool is showing the error.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

 

I tried to follow the instructions of the KBA about setting the output video format to 24-bits and adjusting the resolution to be divisible by 24 bits :

SimonP_1-1636040581553.png

but there is still the same issue in the CX3 Receiver Configuration about the Output pixel Clock (value is still at 202.5 MHz) Is it normal ?

How can I fix this otherwise ? can I adjust the parameter however I wish until there is no more issue ? Is there guildelines to modify CX3 Mipi Interface Configuration tab ?

For now, I would even be happy with having only a couple image per seconds, but I need to keep this resolution (2592x1948)

Best regards,

SimonP

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Please try using the configurations given in the following snapshot:

JayakrishnaT_76_0-1636342491528.png

With these settings, you will see some errors in the MIPI configuration Utility. These errors are caused due to bugs in the MIPI configuration Utility. We are aware of these bugs and it will be fixed in the upcoming release of FX3 SDK. 

You can use these configurations for your requirement by ignoring the errors shown by the utility. Please refer to the KBA shared before to understand the modifications that are to be made on the source files generated by the tool. After this, try building the project and let us know if you face any issues.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

I tried to use the configuration you proposed and updated my project with it.

Generation is going fine but when I try to start the streaming on this interface, I don't get any image (black screen).

I checked the status of MIPI interface and I have a Control Error on the first frame that disappear afterwards. The frame count is increasing but I don't know what is the issue. What else can I look at to identify the issue ?

 

Best regards,

SimonP

 

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Please share the UART debug logs for us to check. Please ensure that the frame sizes are printed in the UART debug logs. This will help us to understand if CX3 is receiving correct amount of data from the sensor or not. If the frame size is not correct, then we you need to verify whether the image sensor configuration settings are proper or not with the sensor vendor.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

Here are the logs when I have the device connected and start the windows "Camera" application to initiate streaming with the device :

SimonP_0-1636964895368.pngSimonP_1-1636964931134.png

I hope these logs can shed some lights on my issue. The configuration I am using was given directly by the sensor company.

Best regards,

SimonP

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

Based on your configuration, the expected frame size can be calculated as follows:

Frame size = (2592 x 1948 x 10)/8 bytes = 6311520 bytes

But, from the UART debug logs, I find that the frame size is constantly 1875328 bytes. This means that the image sensor is sending just 1875328 bytes. As there are no errors from the CX3 side, we suspect that the sensor configurations are incorrect. Please verify the sensor configuration settings again with the image sensor vendor.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hi Jayakrishna,

You're right, I just realised these logs corresponds to a 1288x728 configuration.

Below are the correct logs for the 2592x1948 configuration.

This time the frame size is also different from expected but bigger.

SimonP_0-1637074323528.png

I checked that the sensor is indeed configured for streaming in RAW10, so I'm not sure why there is more pixels than intended and why it is varying. Do you have any guess ?

 

Best regards,

SimonP

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello SimonP,

As you might be knowing, CX3 is just a bridge and it transmits the data received from the image sensor to the host by adding the UVC header. As the frame size seen is varying and greater than the expected frame size, we suspect that there is a mismatch between sensor configuration settings and the MIPI configuration settings.

Please check if the sensor is configured correctly based on the parameters specified in the Image sensor configuration tab of MIPI configuration utility. Also, please probe HSYNC, VSYNC and PCLK test points and share it with us.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

I discussed with the sensor supplier and confirmed the size of the image they are transmitting. When using the RAW10 format, the image is transmitted with 2 bytes per pixels :

2592*1948*16/8 = 10098432 bytes

This does not match what the cypress is expecting and explains why the frame size is much bigger.

I am not sure what is the correct frame size according to the MIPI specification ? I found this KBA related to this topic :

https://community.infineon.com/t5/Knowledge-Base-Articles/Streaming-RAW10-Format-Input-Data-to-16-24...

I understood that the image will be converted into 16bits/pixel when transmitting it over the USB interface. However, I am not sure of my understanding of this KBA, could you confirm me what is the expected encoding of the frame from the sensor : 10bits/pixel or 16bits/pixel ?

Is the frame size printed in the logs corresponding to the input frame size from the sensor or the frame size of the data to be transmitted over the USB interface ?

 

Best regards,

SimonP

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

CX3 can be configured to pack or pad the data from the image sensor. Let us consider the example of packing and padding the incoming video frame of 1920 x 1080 in RAW10 format into 16 bits. 

1. When CX3 is configured to pad the incoming data into 16 bits, it pads 6 additional bits to each pixel and makes each pixel of 16 bits.

So, input frame size from the sensor will be 1920 x 1080 x 10 bits

Output from CX3 will be 1920 x 1080 x 16 bits. The same will be printed in the UART debug logs as frame size.

2. When CX3 is configured to pack the incoming data into 16 bits, it does not add any additional data to the data received from image sensor. It just packs the incoming data into 16 bits. The way CX3 packs the incoming RAW10 data from the image sensor is already mentioned in the following KBA:

https://community.infineon.com/t5/Knowledge-Base-Articles/Streaming-RAW10-Format-Input-Data-to-16-24...

So, here the input frame size from the image sensor will be 1920 x 1080 x 10 bits

Output from CX3 will also be 1920 x 1080 x 10 bits. The same will be printed in UART debug logs as frame size. But, as UVC players do not support RAW 10 format, we modify the resolution (either width or height of the video frame) so that the bits per pixel is made 16 without changing the frame size. More details on this modification is also described in the KBA mentioned above.

Please find my comments to your questions below:

1. "However, I am not sure of my understanding of this KBA, could you confirm me what is the expected encoding of the frame from the sensor : 10bits/pixel or 16bits/pixel?"

>> As you are trying to stream RAW 10, bits per pixel from the sensor side should be 10 bits.

2. "Is the frame size printed in the logs corresponding to the input frame size from the sensor or the frame size of the data to be transmitted over the USB interface?"

>> It is the frame size of the data that is actually received by CX3 (after padding or packing). It is also equal to the size of the data transmitted over the USB interface excluding the UVC header added to each DMA buffer.

Best Regards,
Jayakrishna
0 Likes
SimonP
New Contributor II

Hello Jayakrishna,

 

Thank you for all the information. It was very helpful to understand the mechanism of RAW10 streaming on the CX3.

After discussion with the sensor supplier, we found an issue with the blanking values and we increased the Output pixel clock to 100MHz (max value) and streaming is now finally working ! I kept the output format to 16-bits as I could not make it work with 24-bits output format but everything is working now.

Thank you very much for all your help and information.

Best regards,

SimonP

0 Likes