Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: zb_fan on November 05, 2019, 10:06:43 AM

Title: Using Global Shutter Camera (OV9281) with TE0726
Post by: zb_fan on November 05, 2019, 10:06:43 AM
Hi Oleksandr,

I am trying to marry the OV9281 with the Zynqberry reference design.  :)

Taking the naive approach (just plug it in and using the I2C settings from here: https://gitlab.incom.co/CM-Shield/android_kernel_nvidia_quill/blob/5ff2f17e8a9293d9f15b1a1de73139260ead1967/drivers/media/i2c/ov9281_mode_tbls.h (https://gitlab.incom.co/CM-Shield/android_kernel_nvidia_quill/blob/5ff2f17e8a9293d9f15b1a1de73139260ead1967/drivers/media/i2c/ov9281_mode_tbls.h))
is yielding a distorted image. Which comes as a surprise as I wasn't expecting to see anything at all!  ;)

Anyway, with your experience making the the RPi CSI-2 Cam Modules work, what do you recommend to look for next? Any hint is welcome!

Thanks & Regards,
Thomas


Title: Re: Using Global Shutter Camera (OV9281) with TE0726
Post by: Oleksandr Kiyenko on November 05, 2019, 11:22:10 AM
Hi Thomas,

unfortunately, interfacing with CSI devices is a little tricky, because of closed standards. It's a more reverse engineering task.
1. Check resolution and clock settings. The demo project has 1280x720, in other cases, you have to correct VDMA and framebuffer settings. If possible set slower CSI clock (avoid low resolution with fast clock).
2. Check that you select RAW10 as an output format.
3. Compare R G B pixels positions in RAW format for this sensor with RPi cameras and correct Demosaic if needed.
I will be glad if you inform your progress with this project.

Best regards
Oleksandr Kiyenko
Title: Re: Using Global Shutter Camera (OV9281) with TE0726
Post by: zb_fan on November 05, 2019, 03:42:38 PM
Hi Oleksandr,

Thanks for the fast reply!

The resolution from the I2C settings I found is 1280x720, but I am not sure about the timings. I guess I'll have to try to reengineer it via ILA. I can switch the sensor to generate a test pattern, so this sounds doable.

The CSI format is RAW10 (I think) and I tried to extend your D-PHY ISERDES to 1:10 with no success (got it synthesized but see no output anymore). By now I think it is still 1:8, but the 10bits are packaged differently in MIPI packets. Did you come across any public available information how this could look like?

How about tweaking the SERDES timings/dealy (clk vs. data)? The distorted image looks partially like a missing hsync/vsync (which could be an issue with de-packaging) but has a lot of digital noise too and I think it is coming from the D-PHY/SERDES. I am real just starting here...

The sensor is B/W, so I do not have to worry about demosaic. :)

Thanks & Regards,
Thomas
Title: Re: Using Global Shutter Camera (OV9281) with TE0726
Post by: zb_fan on November 15, 2019, 10:52:03 PM
Hi Oleksandr,

Good news! The OV9281 works almost out of the box with the 2018.2/zynqberrydemo3 reference design! The issue was the 120Hz frame rate with the settings I mentioned. But since the module is B/W I set the raw_demosaic IP to "Bypass" and now the framerate is not an issue anymore! The image is a little dark because the exposure time is low at this frame rate, but it is very clear, especially with motion!

Here is where I bought the camera module:
https://www.uctronics.com/index.php/arducam-ov9281-mipi-camera-module-1mp-monochrome-global-shutter-camera-2084.html

Thanks & best Regards,
Thomas
Title: Re: Using Global Shutter Camera (OV9281) with TE0726
Post by: Oleksandr Kiyenko on November 18, 2019, 10:50:26 AM
Hi Thomas,

thanks for your information, it can help other Zynqberry TE0726 users.

Best regards
Oleksandr