cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

channabasappa
New Contributor II

 AMCAP application  unable to display any data on its screen.  On PC side we are able to see data through USB analyser but not on the AMCAP application.

Image sensor: AR1335
AR1335 configured with : RAW8 , 640*480 @ 2FPS and CSI clock-160MHz

CX3 MIPI Configurations :
INPUT video format :        RAW8
OUTPUT video format :    24bit
                                                   640*480 @ 6FPS and CSI clock-160


CyU3PMipicsiCfg_t:
CyU3PMipicsiDataFormat_t dataFormat :      CY_U3P_CSI_DF_YUV422_8_2 (also tried CY_U3P_CSI_DF_RGB888 , CY_U3P_CSI_DF_RGB565_2 )
hResolution =640

CyCx3USBSSConfigDscr:
Number of bits per pixel:            16 (8 bit also tried )
Width in pixel:                                 320 (640 also tried)
0x59, 0x55, 0x59, 0x32,              /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */
0x00,0x00,0xe1,0x00,            Min bit rate (bits/s):14745600=640*480*8*6
0x00,0x00,0xe1,0x00,            Max bit rate (bits/s):14745600=640*480*8*6
0x00,0xb0,0x04,0x00,           Maximum video or still frame size in bytes(Deprecated)  640*380


CX3- log :
TimeDiff = 10686 ms FPS = 2
Prod = 18 Cons = 18 Prtl_Sz = 28512 Frm_Cnt = 31 Frm_Sz = 691200 B
Prod = 18 Cons = 18 Prtl_Sz = 28512 Frm_Cnt = 32 Frm_Sz = 691200 B
Prod = 18 Cons = 18 Prtl_Sz = 28512 Frm_Cnt = 33 Frm_Sz = 691200 B
Prod = 18 Cons = 18 Prtl_Sz = 28512 Frm_Cnt = 34 Frm_Sz = 691200 B


Screenshot 2021-02-24 143948.jpg

 

 

Screenshot 2021-02-24 144049.jpg

With Regards
channabasappa

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator

Hello,

The expected size of the frame at the host side is same as the frame size in bytes field in the UVC frame descriptor. That is:

Frame size = 640*480 = 320*480*2 = 307200 bytes

The frame size that is received by the host based on the debug prints is 460800 bytes. As you might be knowing, CX3 just forwards the data received from the image sensor to host. Here more data is received at the host. So, I feel that the sensor is sending more data. 

Can you please let us know if you are making use of continuous or gated clock mode?

Regarding the debug prints in sensor.c file, I wanted to check if the writes to the sensor are passing without any issues. Can you please check this and let us know the details?

Also, can you please check if the first parameter of the API CyU3PMipicsiGpifLoad is CY_U3P_MIPICSI_BUS_16 or not?

Best Regards,
Jayakrishna

View solution in original post

0 Likes
8 Replies
JayakrishnaT_76
Moderator
Moderator

Hello,

Firstly, for packing the incoming data into 24 bits, the line size of the frame should be divisible by 24. This is already documented in the following KBA:

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

In this case, the line size can be calculate as follows:

Line size = 640*8 = 5120 bits which is not divisible by 24 bits. 

So, please try packing the incoming data into 16 bits as 5120 is divisible by 16 bits.

Also, the following statements in your question seems to be confusing:

"AR1335 configured with : RAW8 , 640*480 @ 2FPS and CSI clock-160MHz" &

"OUTPUT video format :    24bit
                                                   640*480 @ 6FPS and CSI clock-160"

The UART debug logs shows FPS as 2. Please let us know what exactly is the actual/desired FPS. The sensor configuration and CX3 receiver configuration should match for obtaining the frames correctly.

Best Regards,
Jayakrishna
0 Likes
channabasappa
New Contributor II
Dear Jayakrishna,

Thanks for the suggestions,

Method-1."try packing the incoming data into 16 bits as 5120 is divisible by 16 bits."
This means GPIF_BUS_WIDTH  need to change CY_U3P_MIPICSI_BUS_24 to CY_U3P_MIPICSI_BUS_16 right ?

But CY_U3P_MIPICSI_BUS_16  also is not working.

Method-2.In UVC frame descriptor Line size and Height changed to 600 x256  (i.e 640*480*8 = 600*256*16) .Which is divisible by 24 as well as 16.
With these changes also i am not getting data on display.
on Debug we are getting :
                        A> Frm_sz=691200   for CY_U3P_MIPICSI_BUS_24  
                        B> Frm_sz=460800   for CY_U3P_MIPICSI_BUS_16

clarification on FPS :

Actually  on this same board i am able to stream RAW10 data on to AMCAP.
In that RAW10  project I observed that : if image sensor FPS is less than CX3-MIPI configuration FPS then it was successfully streaming .
i.e on CX3 i configured MIPI settings with 5, 6, 15 and 30FPS for 640*480 Image size and at the same time i kept 1FPS settings on the image sensor.
With these settings I always received 1FPS data on AMCAP successfully.  
Hence in this project i kept 6FPS on CX3 and 2FPS configured for image sensor.

Any how to rule out the FPS synch issue now i kept both MIPI settings and Image settings 2FPS. Even now also we are not getting data on AMCAP.

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

For packing incoming data into 16 or 24 bits, the line size should be a multiple of 16 or 24 bits respectively and not the frame size. By line size, I meant size of a line that is sent out by the image sensor and not what is configured in the UVC descriptor.

In this case, line size will be 640*8 bits. This is divisible by 16 bits and is not divisible by 24 bits. So, packing the incoming data into 24 bits is not possible for this case. 

Also, we do not recommend configuring the sensor and CX3 MIPI receiver with different settings. We will debug this issue in steps. Please follow the steps listed below and let me know the results:

1. Create a new CX3 project using the desired h-active,v-active, blankings, FPS etc. WHile creating the project, make sure that the Output video format setting in Image sensor configuration Tab of MIPI configuration utility is set to 16 bits.

2. Configure the sensor using the same settings as that used in Image sensor configuration Tab of MIPI configuration Utility.

3. Follow the KBA given below for packing the incoming data into 16 bits:

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

Please try this and let me know the result.

Best Regards,
Jayakrishna
0 Likes
channabasappa
New Contributor II

Hi JK,

1. Created New MIPI project for RAW8 with 16Bit output for Image size 640*480
2. Configured MIPI and IMAGE sensors with same settings (2FPS)
3. As per KBA -  on USB Descriptor A) Number of bits per pixel: changed to 16 bits
                                                                      B) Width in pixel changed to 320 (640*480*8=320*480*16)
*There is no any error on the CX3 logs.
*Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 361 Frm_Sz = 460800 B

*On pc as usual data we can see at USB hardware level not on AMCAP player(Just black window).


MIPI_CLOCK+SETTINGS.jpgMIPI_CSI_CONFIG.jpgMIPI_SETTINGS.jpgUSB_DESCRPTR.jpgPC_USB_LOGS.jpg

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

The MIPI Receiver configurations and the descriptor settings seems to be fine. But, as the host is receiving a greater frame size, we suspect that the sensor could be sending more amount of data than the actual frame size. This could happen if the sensor is not configured properly. 

Please share the following so that we can understand more on the issue:

1. Complete UART debug logs with the following line in cyu3imagsensor.c uncommented:

#define SENSOR_DEBUG

2. I believe that a custom board is used for development. In this case, can you please let us know if HSYNC, VSYNC and PCLK test points can be probed or not?

Best Regards,
Jayakrishna
0 Likes
channabasappa
New Contributor II

Hello Jayakrishna,

what should be the expected frame size on host ?

Right now we are using e-CON_DENEBOLA development board with AR1335 Daughter board. (Please find the boards picture below) . we need to probe on BGA vias( TP16,TP18,TP20) but we don't have board file for DENEBOLA board to identify the TPs exactly.

UART debug logs: We made custom cyu3imagsensor.c  for AR1335 . Hence If  you want specific log details kindly let me know .  Here some of the logs attached below.

bRType = 0x81, bRequest = 0x0, wValue = 0x0, wIndex = 0x0, wLength= 0x2
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
AppInit:GpifSMStart passed
Chip ID Read Done = 0x153
FrameCount= 0xFF
Global gain configured
Digital gain configured
Digital gain configured
Digital gain configured
Digital gain configured
Analog gain configured
Analog gain configured
Analog gain configured
Analog gain configured
Analog gain configured
AR1335_Write_baseSettings Done= 0x0
MIPI-160MHz configured
VGA Resolution configured
REG_RESET_SETTINGS = 0x338
Sensor Initialization Done
STANDBY_MODE
EnterSuspendMode Status = 0x0, Wakeup reason = 0x8
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0xA1, bRequest = 0x81, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0x21, bRequest = 0x1, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x81, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x83, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x82, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0x21, bRequest = 0x1, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Set cur Still probe index = 1
bRType = 0xA1, bRequest = 0x81, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0xA1, bRequest = 0x82, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0xA1, bRequest = 0x83, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0x21, bRequest = 0x1, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Set cur Still probe index = 1
bRType = 0xA1, bRequest = 0x81, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0xA1, bRequest = 0x82, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0xA1, bRequest = 0x83, wValue = 0x300, wIndex = 0x1, wLength= 0xB
Get cur Still probe index = 1
bRType = 0x21, bRequest = 0x1, wValue = 0x200, wIndex = 0x1, wLength= 0x22
VGA Resolution configured
AplnStrt:SMState = 0x2
STREAMING_MODE
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 1 Frm_Sz = 460800 B
0 2 0 0 0 0 0 0 0
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 2 Frm_Sz = 460800 B
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 3 Frm_Sz = 460800 B

Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 4 Frm_Sz = 460800 B
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 5 Frm_Sz = 460800 B
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 6 Frm_Sz = 460800 B
Prod = 12 Cons = 12 Prtl_Sz = 19008 Frm_Cnt = 7 Frm_Sz = 460800 B

DENEBOLA_BOARD TOP VIEW.jpegDENEBOLA BOARD BOTTOM VIEW.jpeg

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

The expected size of the frame at the host side is same as the frame size in bytes field in the UVC frame descriptor. That is:

Frame size = 640*480 = 320*480*2 = 307200 bytes

The frame size that is received by the host based on the debug prints is 460800 bytes. As you might be knowing, CX3 just forwards the data received from the image sensor to host. Here more data is received at the host. So, I feel that the sensor is sending more data. 

Can you please let us know if you are making use of continuous or gated clock mode?

Regarding the debug prints in sensor.c file, I wanted to check if the writes to the sensor are passing without any issues. Can you please check this and let us know the details?

Also, can you please check if the first parameter of the API CyU3PMipicsiGpifLoad is CY_U3P_MIPICSI_BUS_16 or not?

Best Regards,
Jayakrishna

View solution in original post

0 Likes
channabasappa
New Contributor II

HI Jayakrishna,

Thanks for the inputs,

Finally it is working now .

Yes frame size of 460800 bytes were received at host side , actually it is more than our expected frame size(307200 bytes) i.e 1.5 times of expected size.

Hence just i increased the fifoDelay on CyU3PMipicsiCfg_t  1.5 times . (i.e 50 to 75 ).
Now i am receiving frame size of 307200 bytes and able to capture data on PC application .

and yes actually  it is now working for both continuous or gated clock mode also .





0 Likes