FX3 720p RAW12 image sensor setup.

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

cross mob
JaKo_4554081
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hi,

I am trying to configure AR0330 image sensor with FX3 chip. The design is based on AN75779 example code, but with different board, same factor :

(https://www.digikey.pl/en/products/detail/onsemi/AR0330CS1C12SPKAH3-GEVB/7561928?s=N4IgjCBcoLQBxVAYy...).

The driver for image sensor looks fine. All the remaining configuration has been written with accordance to ONSemi documentation and has been tested.

I am experiencing an issue, where amount of buffers each X frames are inconsistent, and there is no video output on host application.

JaKo_4554081_0-1644573670418.png

First attempts resulted in DMA errors, so the DMA buffer has been extended with information that I have found on this forum, these changes include:

In file cyfxgpif2config.h the CY_U3P_PIB_GPIF_ADDR_COUNT_LIMIT has been increased to: 0x00007FEF (from 0x00003FEF). Also CY_U3P_PIB_GPIF_DATA_COUNT_LIMIT has been increased to: 0x00007FEF (from 0x00003FEF).

Later I have changed the amount of byted device can rx in single payload:

JaKo_4554081_1-1644573841189.png

In uvc.h CY_FX_EP_BULK_VIDEO_PKTS_COUNT has been increased to 0x20, CY_FX_UVC_STREAM_BUF_COUNT was lowered to (with 4 I have experienced errors).

No here is the part that I am not certain about, changes in descriptor:

JaKo_4554081_2-1644573915085.png

The bitrate has been calculated as follows 1280x720x2x30x12 (for minimum bit rate, and additional x2 for max bit rate). AR0330 output is of RAW12 format with 12 parallel bus (we are using 8 atm due to hardware limitations). Also, the sensor output is 60FPS so descriptor was modified accordingly.

1. What is more likely the cause of this issue ? sensor setup, or  UVC/DMA setup on FX3 side ?

2. Could this be caused by data format ? RAW12 instead of YUY2 ? Atm I am doing a proof of concept so I do not care about the quality of the image, that can be solved later. All i need is to see any image on host application to proceed with the project. 

3. Later in the project we aim for 1980x1080 @ 30 FPS. Will this be possible with FX and USB superspeed ?

Thanks in advance for all the help and guidance.

 

 

 

 

 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Thank You for reply. I am attaching project files to this reply. Unfortunately I have to remove sensor related files from these project, as documents on which it was based were shared to me after signing an NDA.

I have reverted changes, and re-calculated bit rates. 

Some questions to You answers:

4. I understand. The 8 bit interface is used only because the current hardware limitations. Later custom PCB will be designed which will use 12 bit parallel interface. So assuming 12 bit parallel interface, in order to achieve 1980*1080 @ 30FPS we will have to connect all 12 bits to the MCU, and use 16 bit GPIF interface discarding least significant bits ? (12 lane bus connected to 16 lane bus). Will this work ?

With current setup I receive a buffer failure from time to time:

JaKo_4554081_1-1644585558173.png

 

Sensor was programmed as per datasheets, except for resolution. Parameters for setting these were not given in datasheets, so to set everything up I have taken these values from some linux driver for this sensor. I assume that they are correct, but You never know. 

This is the driver that can be used for some reference if needed:

https://github.com/productize/linux-tegra/blob/camera-ar0330/drivers/media/i2c/soc_camera/ar0330.c

 

EDIT

Upon doing modifications as per 3.6.5 of AN75779 I have some positive results:

JaKo_4554081_0-1644589274278.png

Image received is all green (but I can see my hand moving in the background). Is this due to RAW12 being decoded as YUY2 ? Can I assume that the sensor is now working properly ? 

However even though it is working logs keep showing periodical errors:

JaKo_4554081_0-1644590995608.png

What is the reason behind it ?

 

 

View solution in original post

0 Likes
4 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

1. Please do not change the cyfxgpif2config.h file manually. This file is generated using the GPIF II Designer software and the values are set according to the state machine defined.

2. If the sensor output is 60fps, why is the bit rate calculated in terms of 30 fps?

3. RAW12 video data can be streamed on the host application, using YUY2 GUID in the descriptors.

4. 1980*1080 @30FPS would not be possible with an 8 bit GPIF. Minimum 16 bit GPIF would be required for streaming.

4. Could you share with us the firmware rolling back the changes made to the uvc.c, uvc.h, cyfxgpif2config.h and to the descriptor file?

Best Regards,
AliAsgar

lock attach
Attachments are accessible only for community members.

Thank You for reply. I am attaching project files to this reply. Unfortunately I have to remove sensor related files from these project, as documents on which it was based were shared to me after signing an NDA.

I have reverted changes, and re-calculated bit rates. 

Some questions to You answers:

4. I understand. The 8 bit interface is used only because the current hardware limitations. Later custom PCB will be designed which will use 12 bit parallel interface. So assuming 12 bit parallel interface, in order to achieve 1980*1080 @ 30FPS we will have to connect all 12 bits to the MCU, and use 16 bit GPIF interface discarding least significant bits ? (12 lane bus connected to 16 lane bus). Will this work ?

With current setup I receive a buffer failure from time to time:

JaKo_4554081_1-1644585558173.png

 

Sensor was programmed as per datasheets, except for resolution. Parameters for setting these were not given in datasheets, so to set everything up I have taken these values from some linux driver for this sensor. I assume that they are correct, but You never know. 

This is the driver that can be used for some reference if needed:

https://github.com/productize/linux-tegra/blob/camera-ar0330/drivers/media/i2c/soc_camera/ar0330.c

 

EDIT

Upon doing modifications as per 3.6.5 of AN75779 I have some positive results:

JaKo_4554081_0-1644589274278.png

Image received is all green (but I can see my hand moving in the background). Is this due to RAW12 being decoded as YUY2 ? Can I assume that the sensor is now working properly ? 

However even though it is working logs keep showing periodical errors:

JaKo_4554081_0-1644590995608.png

What is the reason behind it ?

 

 

0 Likes

Hi,

If 12 bits of the GPIF are used, 1920*1080@30FPS resolution and frame rate can be realized. It should not be a problem, if 100MHz clock is used.
(100*1000*1000)*12 > 1980*1080*30*16.

You are right, the green video is because of conversion of RAW12 to YUY2.

Workaround for the commit buffer failures is already provided in the firmware.
Although, if removing of commit buffer failures is desired, Please go through the given KBA.https://community.infineon.com/t5/Knowledge-Base-Articles/FX3-Error-in-CyU3PDmaMultiChannelCommitBuf...

Best Regards
AliAsgar

Thank You very much for all the assistance 🙂 

0 Likes