Since quite some time i have been involved with different type of camera sensors and interfacing to to various processors. In my recent project i took Raspberry PI Camera Sony IMX219 MIPI CSI and interfaced to FPGA and streamed over USB3.0 Link.
There are many MIPI CSI to parallel bridge designs available from many FPGA manufacturer but none of them are open source they either have some blackbox modules or uses some very application specific processor. So i made this design with cheap Lattice MachXO3LF FPGA.
I made my own camera board around the sensor from raspberry pi. As turned out IMX219 is 4 lane camera but raspberry pi's board only uses 2 lane mipi and I wanted 4 so that i can run mipi clock slower but still get full performance out of the camera.
more details about the project can be found on my blog
https://www.circuitvalley.com/2020/02/imx219-camera-mipi-csi-receiver-fpga-lattice-raspberry-pi-camera.html
https://www.circuitvalley.com/2020/02/diy-imx219-4-lane-mipi-breakout-board-raspberry-pi-camera-fpga-4-lane-mipi-csi.html
I have just published a Project with Lattice FPGA interfacing to IMX219 Raspberry pi camera.
As this is a RAW camera sensor , to get color outof the image Debayer / demosaic need to be performed .
But the problem is datasheet of the camera is quite ambiguous when it comes to what bayer patter this camera has. IMX219 datasheet incorrectly mention output as to be either GBRG or RGGB. but linux driver code says IMX219 Camera only output BGGR , MEDIA_BUS_FMT_SBGGR10_1X10 .
Problem is if i set FPGA's debayer filter input format to BGGR live image comes good in colors. but Test patterns which are defined in camera datasheet have R and B channels exchanged.
And when i set FPGA's debayer filter type to RGGB test pattern comes exactly as the camera datasheet but live image have R and B channels exchanged so what ever is actually blue will look red and what ever is red will look blue in live image.
Image attached to this post shows the issue.
Datasheet can be found here.
https://github.com/circuitvalley/mipi_csi_receiver_FPGA/tree/master/Camera%20DatasheetMy question is anyone worked with this kind of camera or may be this exact camera can shine some light on what is wrong.
I have published two youtube videos, but i am still new bie to videos.
Regards